--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# 	NOTE
##  Due to the data protection rules of the IAB, observations <= 100 were replaced by "NA". 
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  \\iab.baintern.de\DFS\017\Ablagen\D01700-Projekte\D01700-COAL\log/7biocoal_2_20230109.log
  log type:  text
 opened on:   9 Jan 2023, 02:44:09
r; t=0.00 2:44:09
.         }
r; t=0.00 2:44:09

. 
. *** OPEN DATA FILE ***
. 
. use ${data}\precoll.dta, clear
r; t=0.00 2:44:28

. *
. * We use precoll, produced by 5estimations - based on postprep_2
. *   (postprep_2 means that for the production of these results, use sample 2
. *       (see datadoc - alternative: use only one series of employment biography 
. *       (postprep_3, postprep_4) or not impute black holes as own spells with status (postprep_1)
. * 
. cap drop lignite
r; t=0.00 2:44:28

. gen lignite=thisspelllignite
(208,342 missing values generated)
r; t=0.00 2:44:28

. label var lignite "this spell is lignite"
r; t=0.00 2:44:29

. *rename persnr pid
. cap rename wz08_kons_num wz08
r; t=0.00 2:44:29

. 
. 
. /* ------------------------------------------------------------------------ */
. * (!!!) Figures & empirical evidence used in Biocoal paper (!!!)
. /* ------------------------------------------------------------------------ */  
. 
. * note that the sum of individuals in different cells may be higher, as some
. * individuals may contribute to several cells.
.         
.         * not chronological in order of paper: Table 1 is below...
.         
. /* ------------------------------------------------------------------------ */
.  *      Figure 1 - "Abs number of lignite mining & services employees per mining region"
. /* ------------------------------------------------------------------------ */          
.         forvalues t = 1975/$maxyear {
  2.                 di "Tabulate size of lignite industry across different mining areas in year `t'"
  3.                 estpost tab mining_area if mdy(06,30,`t') >= begepi & mdy(06,30,`t') <= endepi & thisspelllignite == 1
  4.                 estimates store y`t'
  5.         }
Tabulate size of lignite industry across different mining areas in year 1975

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3233   15.22128   15.22128 
Rheinische~r |     15023   70.72976   85.95104 
Other_Revi~e |      2984   14.04896        100 
-------------+---------------------------------
       Total |     21240        100            
Tabulate size of lignite industry across different mining areas in year 1976

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3257   15.06197   15.06197 
Rheinische~r |     15305   70.77784   85.83981 
Other_Revi~e |      3062   14.16019        100 
-------------+---------------------------------
       Total |     21624        100            
Tabulate size of lignite industry across different mining areas in year 1977

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3202   14.92913   14.92913 
Rheinische~r |     15278   71.23275   86.16188 
Other_Revi~e |      2968   13.83812        100 
-------------+---------------------------------
       Total |     21448        100            
Tabulate size of lignite industry across different mining areas in year 1978

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3131    15.9047    15.9047 
Rheinische~r |     13636    69.2675    85.1722 
Other_Revi~e |      2919    14.8278        100 
-------------+---------------------------------
       Total |     19686        100            
Tabulate size of lignite industry across different mining areas in year 1979

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3170   15.78292   15.78292 
Rheinische~r |     14146   70.43067   86.21359 
Other_Revi~e |      2769   13.78641        100 
-------------+---------------------------------
       Total |     20085        100            
Tabulate size of lignite industry across different mining areas in year 1980

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3246   15.70164   15.70164 
Rheinische~r |     14864   71.90055   87.60219 
Other_Revi~e |      2563   12.39781        100 
-------------+---------------------------------
       Total |     20673        100            
Tabulate size of lignite industry across different mining areas in year 1981

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3295   15.76178   15.76178 
Rheinische~r |     15280   73.09256   88.85434 
Other_Revi~e |      2330   11.14566        100 
-------------+---------------------------------
       Total |     20905        100            
Tabulate size of lignite industry across different mining areas in year 1982

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3378   15.71017   15.71017 
Rheinische~r |     15962   74.23495   89.94512 
Other_Revi~e |      2162   10.05488        100 
-------------+---------------------------------
       Total |     21502        100            
Tabulate size of lignite industry across different mining areas in year 1983

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3351   16.17512   16.17512 
Rheinische~r |     15871   76.60858    92.7837 
Other_Revi~e |      1495   7.216296        100 
-------------+---------------------------------
       Total |     20717        100            
Tabulate size of lignite industry across different mining areas in year 1984

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3320   16.19354   16.19354 
Rheinische~r |     15862   77.36806    93.5616 
Other_Revi~e |      1320   6.438396        100 
-------------+---------------------------------
       Total |     20502        100            
Tabulate size of lignite industry across different mining areas in year 1985

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3192   15.85221   15.85221 
Rheinische~r |     15707   78.00457   93.85677 
Other_Revi~e |      1237   6.143226        100 
-------------+---------------------------------
       Total |     20136        100            
Tabulate size of lignite industry across different mining areas in year 1986

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3084   15.49905   15.49905 
Rheinische~r |     15627   78.53553   94.03458 
Other_Revi~e |      1187   5.965424        100 
-------------+---------------------------------
       Total |     19898        100            
Tabulate size of lignite industry across different mining areas in year 1987

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      3109   15.63726   15.63726 
Rheinische~r |     15681   78.87033   94.50759 
Other_Revi~e |      1092   5.492405        100 
-------------+---------------------------------
       Total |     19882        100            
Tabulate size of lignite industry across different mining areas in year 1988

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      2921   15.21592   15.21592 
Rheinische~r |     15324   79.82497   95.04089 
Other_Revi~e |       952   4.959108        100 
-------------+---------------------------------
       Total |     19197        100            
Tabulate size of lignite industry across different mining areas in year 1989

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      2708   15.31674   15.31674 
Rheinische~r |     14170   80.14706    95.4638 
Other_Revi~e |       802   4.536199        100 
-------------+---------------------------------
       Total |     17680        100            
Tabulate size of lignite industry across different mining areas in year 1990

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      2627   15.10812   15.10812 
Rheinische~r |     14123   81.22268    96.3308 
Other_Revi~e |       638   3.669197        100 
-------------+---------------------------------
       Total |     17388        100            
Tabulate size of lignite industry across different mining areas in year 1991

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
Helmstedte~r |      2578   15.05841   15.05841 
Rheinische~r |     14034    81.9743   97.03271 
Other_Revi~e |       508    2.96729        100 
-------------+---------------------------------
       Total |     17120        100            
Tabulate size of lignite industry across different mining areas in year 1992

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |     47137   52.47006   52.47006 
           2 |     26554   29.55831   82.02836 
           3 |      2470   2.749455   84.77782 
           4 |     13458   14.98063   99.75845 
           5 |       217   .2415513        100 
-------------+---------------------------------
       Total |     89836        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 1993

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |     32429   49.19373   49.19373 
           2 |     18649   28.28992   77.48365 
           3 |      2149   3.259963   80.74362 
           4 |     12535   19.01518    99.7588 
           5 |       159   .2411978        100 
-------------+---------------------------------
       Total |     65921        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 1994

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |     23190   45.39315   45.39315 
           2 |     14070   27.54125   72.93441 
           3 |      1904   3.726976   76.66138 
           4 |     11801   23.09981   99.76119 
           5 |       122   .2388083        100 
-------------+---------------------------------
       Total |     51087        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 1995

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |     20892   44.69068   44.69068 
           2 |     12988   27.78301   72.47369 
           3 |      1797   3.844015    76.3177 
           4 |     10965   23.45555   99.77325 
           5 |       106   .2267477        100 
-------------+---------------------------------
       Total |     46748        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 1996

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |     15116   41.16558   41.16558 
           2 |      9258   25.21242     66.378 
           3 |      1723   4.692266   71.07026 
           4 |     10533   28.68464    99.7549 
           5 |        NA    	 NA         NA 
-------------+---------------------------------
       Total |     36720        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 1997

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |     12884    41.6123    41.6123 
           2 |      6251   20.18926   61.80156 
           3 |      1637   5.287126   67.08869 
           4 |     10100   32.62063   99.70932 
           5 |        NA    	 NA         NA 
-------------+---------------------------------
       Total |     30962        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 1998

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |     10544   37.66252   37.66252 
           2 |      4802   17.15245   54.81497 
           3 |      1710   6.108015   60.92299 
           4 |     10843   38.73053   99.65352 
           5 |        NA    	 NA         NA 
-------------+---------------------------------
       Total |     27996        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 1999

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      8099   33.95807   33.95807 
           2 |      3741   15.68553   49.64361 
           3 |      1526   6.398323   56.04193 
           4 |     10388   43.55556   99.59748 
           5 |        NA    	 NA         NA 
-------------+---------------------------------
       Total |     23850        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2000

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      7743   33.41389   33.41389 
           2 |      3639   15.70362   49.11751 
           3 |      1484   6.404005   55.52151 
           4 |     10197    44.0038   99.52531 
           5 |       110   .4746904        100 
-------------+---------------------------------
       Total |     23173        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2001

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      7256   35.04468   35.04468 
           2 |      2891   13.96281   49.00749 
           3 |      1397   6.747163   55.75465 
           4 |      9047   43.69476   99.44941 
           5 |       114   .5505916        100 
-------------+---------------------------------
       Total |     20705        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2002

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      7059   35.41364   35.41364 
           2 |      2864   14.36813   49.78177 
           3 |      1265    6.34626   56.12803 
           4 |      8577   43.02915   99.15718 
           5 |       168   .8428235        100 
-------------+---------------------------------
       Total |     19933        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2003

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      6570    34.3961    34.3961 
           2 |      2761   14.45474   48.85085 
           3 |      1107   5.795508   54.64635 
           4 |      8238   43.12863   97.77499 
           5 |       425   2.225014        100 
-------------+---------------------------------
       Total |     19101        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2004

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      6355   36.56081   36.56081 
           2 |      2676   15.39524   51.95605 
           3 |      1037   5.965942   57.92199 
           4 |      6916   39.78829   97.71027 
           5 |       398   2.289725        100 
-------------+---------------------------------
       Total |     17382        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2005

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      6159   36.99543   36.99543 
           2 |      2620   15.73763   52.73306 
           3 |       899   5.400048   58.13311 
           4 |      6574   39.48823   97.62134 
           5 |       396   2.378664        100 
-------------+---------------------------------
       Total |     16648        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2006

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5655   35.65574   35.65574 
           2 |      2613   16.47541   52.13115 
           3 |       862   5.435057    57.5662 
           4 |      6361   40.10719   97.67339 
           5 |       369   2.326608        100 
-------------+---------------------------------
       Total |     15860        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2007

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5701   35.10684   35.10684 
           2 |      2583   15.90615   51.01299 
           3 |       860   5.295893   56.30889 
           4 |      6839   42.11466   98.42355 
           5 |       256   1.576452        100 
-------------+---------------------------------
       Total |     16239        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2008

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5781   35.74697   35.74697 
           2 |      2549   15.76181   51.50878 
           3 |       719   4.445956   55.95474 
           4 |      6887   42.58595   98.54069 
           5 |       236   1.459312        100 
-------------+---------------------------------
       Total |     16172        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2009

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5632   35.43921   35.43921 
           2 |      2520   15.85703   51.29625 
           3 |       714   4.492827   55.78908 
           4 |      6823   42.93355   98.72263 
           5 |       203   1.277372        100 
-------------+---------------------------------
       Total |     15892        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2010

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5666   35.72509   35.72509 
           2 |      2459   15.50441   51.22951 
           3 |       703   4.432535   55.66204 
           4 |      6848   43.17781   98.83985 
           5 |       184   1.160151        100 
-------------+---------------------------------
       Total |     15860        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2011

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5780   36.02144   36.02144 
           2 |      2494   15.54281   51.56425 
           3 |       739   4.605509   56.16976 
           4 |      6853   42.70846   98.87823 
           5 |       180   1.121775        100 
-------------+---------------------------------
       Total |     16046        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2012

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5830   36.74524   36.74524 
           2 |      2435   15.34728   52.09252 
           3 |       730   4.601034   56.69356 
           4 |      6699   42.22236   98.91592 
           5 |       172   1.084079        100 
-------------+---------------------------------
       Total |     15866        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2013

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5946   37.71646   37.71646 
           2 |      2313   14.67174    52.3882 
           3 |       726   4.605138   56.99334 
           4 |      6600   41.86489   98.85823 
           5 |       180    1.14177        100 
-------------+---------------------------------
       Total |     15765        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2014

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5972   39.38015   39.38015 
           2 |      2327   15.34454    54.7247 
           3 |       251   1.655127   56.37982 
           4 |      6436   42.43983   98.81965 
           5 |       179   1.180349        100 
-------------+---------------------------------
       Total |     15165        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2015

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5885   40.25859   40.25859 
           2 |      2330   15.93925   56.19784 
           3 |       221   1.511835   57.70967 
           4 |      6001   41.05213    98.7618 
           5 |       181   1.238199        100 
-------------+---------------------------------
       Total |     14618        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2016

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5734   40.92791   40.92791 
           2 |      2240   15.98858   56.91649 
           3 |       193   1.377587   58.29408 
           4 |      5651   40.33547   98.62955 
           5 |       192    1.37045        100 
-------------+---------------------------------
       Total |     14010        100            

row labels saved in macro e(labels)
Tabulate size of lignite industry across different mining areas in year 2017

 mining_area |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
           1 |      5450   42.26772   42.26772 
           2 |      2068   16.03847   58.30619 
           3 |       189   1.465798   59.77199 
           4 |      5007   38.83201     98.604 
           5 |       180   1.395998        100 
-------------+---------------------------------
       Total |     12894        100            

row labels saved in macro e(labels)
r; t=0.00 2:44:54

.         esttab y* using results/${samplefolder}/7b_empareas.csv, label plain replace 
(file results/two/7b_empareas.csv not found)
(output written to results/two/7b_empareas.csv)
r; t=0.00 2:44:54

.         estimates clear 
r; t=0.00 2:44:54

.         
. /* ------------------------------------------------------------------------ */
.  *      Figure 2 - "Absolute number of employees in relevant industry sectors"
.                                         *  - "Number of employees in lignite mining and mining services"
. /* ------------------------------------------------------------------------ */
.         forvalues t = 1975/$maxyear {
  2.                 di "Differentiate number of employees in lignite mining and mining services in year `t'"
  3.                 tab thisspelllig_cat if mdy(06,30,`t') >= begepi & mdy(06,30,`t') <= endepi & thisspelllignite == 1
  4.                 estpost tab thisspelllig_cat if mdy(06,30,`t') >= begepi & mdy(06,30,`t') <= endepi & thisspelllignite == 1
  5.                 estimates store y`t'
  6.         }
Differentiate number of employees in lignite mining and mining services in year 1975

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      2,294       10.80       10.80
 lignite mining |     18,946       89.20      100.00
----------------+-----------------------------------
          Total |     21,240      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      2294   10.80038   10.80038 
lignite_mi~g |     18946   89.19962        100 
-------------+---------------------------------
       Total |     21240        100            
Differentiate number of employees in lignite mining and mining services in year 1976

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      2,338       10.81       10.81
 lignite mining |     19,286       89.19      100.00
----------------+-----------------------------------
          Total |     21,624      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      2338   10.81206   10.81206 
lignite_mi~g |     19286   89.18794        100 
-------------+---------------------------------
       Total |     21624        100            
Differentiate number of employees in lignite mining and mining services in year 1977

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      2,290       10.68       10.68
 lignite mining |     19,158       89.32      100.00
----------------+-----------------------------------
          Total |     21,448      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      2290   10.67699   10.67699 
lignite_mi~g |     19158   89.32301        100 
-------------+---------------------------------
       Total |     21448        100            
Differentiate number of employees in lignite mining and mining services in year 1978

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,015       30.55       30.55
 lignite mining |     13,671       69.45      100.00
----------------+-----------------------------------
          Total |     19,686      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6015   30.55471   30.55471 
lignite_mi~g |     13671   69.44529        100 
-------------+---------------------------------
       Total |     19686        100            
Differentiate number of employees in lignite mining and mining services in year 1979

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,061       30.18       30.18
 lignite mining |     14,024       69.82      100.00
----------------+-----------------------------------
          Total |     20,085      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6061   30.17675   30.17675 
lignite_mi~g |     14024   69.82325        100 
-------------+---------------------------------
       Total |     20085        100            
Differentiate number of employees in lignite mining and mining services in year 1980

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,283       30.39       30.39
 lignite mining |     14,390       69.61      100.00
----------------+-----------------------------------
          Total |     20,673      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6283    30.3923    30.3923 
lignite_mi~g |     14390    69.6077        100 
-------------+---------------------------------
       Total |     20673        100            
Differentiate number of employees in lignite mining and mining services in year 1981

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,440       30.81       30.81
 lignite mining |     14,465       69.19      100.00
----------------+-----------------------------------
          Total |     20,905      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6440   30.80603   30.80603 
lignite_mi~g |     14465   69.19397        100 
-------------+---------------------------------
       Total |     20905        100            
Differentiate number of employees in lignite mining and mining services in year 1982

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,790       31.58       31.58
 lignite mining |     14,712       68.42      100.00
----------------+-----------------------------------
          Total |     21,502      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6790   31.57846   31.57846 
lignite_mi~g |     14712   68.42154        100 
-------------+---------------------------------
       Total |     21502        100            
Differentiate number of employees in lignite mining and mining services in year 1983

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,670       32.20       32.20
 lignite mining |     14,047       67.80      100.00
----------------+-----------------------------------
          Total |     20,717      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6670   32.19578   32.19578 
lignite_mi~g |     14047   67.80422        100 
-------------+---------------------------------
       Total |     20717        100            
Differentiate number of employees in lignite mining and mining services in year 1984

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,579       32.09       32.09
 lignite mining |     13,923       67.91      100.00
----------------+-----------------------------------
          Total |     20,502      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6579   32.08955   32.08955 
lignite_mi~g |     13923   67.91045        100 
-------------+---------------------------------
       Total |     20502        100            
Differentiate number of employees in lignite mining and mining services in year 1985

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,366       31.62       31.62
 lignite mining |     13,770       68.38      100.00
----------------+-----------------------------------
          Total |     20,136      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6366   31.61502   31.61502 
lignite_mi~g |     13770   68.38498        100 
-------------+---------------------------------
       Total |     20136        100            
Differentiate number of employees in lignite mining and mining services in year 1986

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,412       32.22       32.22
 lignite mining |     13,486       67.78      100.00
----------------+-----------------------------------
          Total |     19,898      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6412   32.22434   32.22434 
lignite_mi~g |     13486   67.77566        100 
-------------+---------------------------------
       Total |     19898        100            
Differentiate number of employees in lignite mining and mining services in year 1987

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,378       32.08       32.08
 lignite mining |     13,504       67.92      100.00
----------------+-----------------------------------
          Total |     19,882      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6378   32.07927   32.07927 
lignite_mi~g |     13504   67.92073        100 
-------------+---------------------------------
       Total |     19882        100            
Differentiate number of employees in lignite mining and mining services in year 1988

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,952       31.00       31.00
 lignite mining |     13,245       69.00      100.00
----------------+-----------------------------------
          Total |     19,197      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5952   31.00484   31.00484 
lignite_mi~g |     13245   68.99516        100 
-------------+---------------------------------
       Total |     19197        100            
Differentiate number of employees in lignite mining and mining services in year 1989

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,590       31.62       31.62
 lignite mining |     12,090       68.38      100.00
----------------+-----------------------------------
          Total |     17,680      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5590   31.61765   31.61765 
lignite_mi~g |     12090   68.38235        100 
-------------+---------------------------------
       Total |     17680        100            
Differentiate number of employees in lignite mining and mining services in year 1990

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,598       32.19       32.19
 lignite mining |     11,790       67.81      100.00
----------------+-----------------------------------
          Total |     17,388      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5598   32.19462   32.19462 
lignite_mi~g |     11790   67.80538        100 
-------------+---------------------------------
       Total |     17388        100            
Differentiate number of employees in lignite mining and mining services in year 1991

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,502       29.38       29.38
 lignite mining |     13,225       70.62      100.00
----------------+-----------------------------------
          Total |     18,727      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5502   29.38004   29.38004 
lignite_mi~g |     13225   70.61996        100 
-------------+---------------------------------
       Total |     18727        100            
Differentiate number of employees in lignite mining and mining services in year 1992

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,487        6.09        6.09
 lignite mining |     84,601       93.91      100.00
----------------+-----------------------------------
          Total |     90,088      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5487   6.090711   6.090711 
lignite_mi~g |     84601   93.90929        100 
-------------+---------------------------------
       Total |     90088        100            
Differentiate number of employees in lignite mining and mining services in year 1993

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,226        7.91        7.91
 lignite mining |     60,882       92.09      100.00
----------------+-----------------------------------
          Total |     66,108      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5226   7.905246   7.905246 
lignite_mi~g |     60882   92.09475        100 
-------------+---------------------------------
       Total |     66108        100            
Differentiate number of employees in lignite mining and mining services in year 1994

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      8,283       16.17       16.17
 lignite mining |     42,952       83.83      100.00
----------------+-----------------------------------
          Total |     51,235      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      8283   16.16668   16.16668 
lignite_mi~g |     42952   83.83332        100 
-------------+---------------------------------
       Total |     51235        100            
Differentiate number of employees in lignite mining and mining services in year 1995

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      7,289       15.56       15.56
 lignite mining |     39,556       84.44      100.00
----------------+-----------------------------------
          Total |     46,845      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      7289   15.55982   15.55982 
lignite_mi~g |     39556   84.44018        100 
-------------+---------------------------------
       Total |     46845        100            
Differentiate number of employees in lignite mining and mining services in year 1996

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,597       17.94       17.94
 lignite mining |     30,177       82.06      100.00
----------------+-----------------------------------
          Total |     36,774      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6597    17.9393    17.9393 
lignite_mi~g |     30177    82.0607        100 
-------------+---------------------------------
       Total |     36774        100            
Differentiate number of employees in lignite mining and mining services in year 1997

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,273       20.26       20.26
 lignite mining |     24,697       79.74      100.00
----------------+-----------------------------------
          Total |     30,970      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6273   20.25509   20.25509 
lignite_mi~g |     24697   79.74491        100 
-------------+---------------------------------
       Total |     30970        100            
Differentiate number of employees in lignite mining and mining services in year 1998

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      7,023       25.08       25.08
 lignite mining |     20,980       74.92      100.00
----------------+-----------------------------------
          Total |     28,003      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      7023   25.07946   25.07946 
lignite_mi~g |     20980   74.92054        100 
-------------+---------------------------------
       Total |     28003        100            
Differentiate number of employees in lignite mining and mining services in year 1999

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,461       27.08       27.08
 lignite mining |     17,394       72.92      100.00
----------------+-----------------------------------
          Total |     23,855      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6461   27.08447   27.08447 
lignite_mi~g |     17394   72.91553        100 
-------------+---------------------------------
       Total |     23855        100            
Differentiate number of employees in lignite mining and mining services in year 2000

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,602       28.49       28.49
 lignite mining |     16,574       71.51      100.00
----------------+-----------------------------------
          Total |     23,176      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6602   28.48637   28.48637 
lignite_mi~g |     16574   71.51363        100 
-------------+---------------------------------
       Total |     23176        100            
Differentiate number of employees in lignite mining and mining services in year 2001

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,173       29.81       29.81
 lignite mining |     14,534       70.19      100.00
----------------+-----------------------------------
          Total |     20,707      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6173   29.81117   29.81117 
lignite_mi~g |     14534   70.18883        100 
-------------+---------------------------------
       Total |     20707        100            
Differentiate number of employees in lignite mining and mining services in year 2002

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,634       33.28       33.28
 lignite mining |     13,301       66.72      100.00
----------------+-----------------------------------
          Total |     19,935      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6634   33.27815   33.27815 
lignite_mi~g |     13301   66.72185        100 
-------------+---------------------------------
       Total |     19935        100            
Differentiate number of employees in lignite mining and mining services in year 2003

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,250       32.72       32.72
 lignite mining |     12,851       67.28      100.00
----------------+-----------------------------------
          Total |     19,101      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6250    32.7208    32.7208 
lignite_mi~g |     12851    67.2792        100 
-------------+---------------------------------
       Total |     19101        100            
Differentiate number of employees in lignite mining and mining services in year 2004

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      6,025       34.66       34.66
 lignite mining |     11,357       65.34      100.00
----------------+-----------------------------------
          Total |     17,382      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      6025   34.66229   34.66229 
lignite_mi~g |     11357   65.33771        100 
-------------+---------------------------------
       Total |     17382        100            
Differentiate number of employees in lignite mining and mining services in year 2005

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,862       35.21       35.21
 lignite mining |     10,786       64.79      100.00
----------------+-----------------------------------
          Total |     16,648      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5862   35.21144   35.21144 
lignite_mi~g |     10786   64.78856        100 
-------------+---------------------------------
       Total |     16648        100            
Differentiate number of employees in lignite mining and mining services in year 2006

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,674       35.78       35.78
 lignite mining |     10,186       64.22      100.00
----------------+-----------------------------------
          Total |     15,860      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5674   35.77554   35.77554 
lignite_mi~g |     10186   64.22446        100 
-------------+---------------------------------
       Total |     15860        100            
Differentiate number of employees in lignite mining and mining services in year 2007

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,600       34.48       34.48
 lignite mining |     10,639       65.52      100.00
----------------+-----------------------------------
          Total |     16,239      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5600   34.48488   34.48488 
lignite_mi~g |     10639   65.51512        100 
-------------+---------------------------------
       Total |     16239        100            
Differentiate number of employees in lignite mining and mining services in year 2008

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,738       35.48       35.48
 lignite mining |     10,434       64.52      100.00
----------------+-----------------------------------
          Total |     16,172      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5738   35.48108   35.48108 
lignite_mi~g |     10434   64.51892        100 
-------------+---------------------------------
       Total |     16172        100            
Differentiate number of employees in lignite mining and mining services in year 2009

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,802       36.51       36.51
 lignite mining |     10,090       63.49      100.00
----------------+-----------------------------------
          Total |     15,892      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5802   36.50894   36.50894 
lignite_mi~g |     10090   63.49106        100 
-------------+---------------------------------
       Total |     15892        100            
Differentiate number of employees in lignite mining and mining services in year 2010

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,800       36.57       36.57
 lignite mining |     10,060       63.43      100.00
----------------+-----------------------------------
          Total |     15,860      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5800   36.56999   36.56999 
lignite_mi~g |     10060   63.43001        100 
-------------+---------------------------------
       Total |     15860        100            
Differentiate number of employees in lignite mining and mining services in year 2011

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,901       36.78       36.78
 lignite mining |     10,145       63.22      100.00
----------------+-----------------------------------
          Total |     16,046      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5901   36.77552   36.77552 
lignite_mi~g |     10145   63.22448        100 
-------------+---------------------------------
       Total |     16046        100            
Differentiate number of employees in lignite mining and mining services in year 2012

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,859       36.93       36.93
 lignite mining |     10,007       63.07      100.00
----------------+-----------------------------------
          Total |     15,866      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5859   36.92802   36.92802 
lignite_mi~g |     10007   63.07198        100 
-------------+---------------------------------
       Total |     15866        100            
Differentiate number of employees in lignite mining and mining services in year 2013

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,858       37.16       37.16
 lignite mining |      9,907       62.84      100.00
----------------+-----------------------------------
          Total |     15,765      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5858   37.15826   37.15826 
lignite_mi~g |      9907   62.84174        100 
-------------+---------------------------------
       Total |     15765        100            
Differentiate number of employees in lignite mining and mining services in year 2014

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,738       37.84       37.84
 lignite mining |      9,427       62.16      100.00
----------------+-----------------------------------
          Total |     15,165      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5738   37.83712   37.83712 
lignite_mi~g |      9427   62.16288        100 
-------------+---------------------------------
       Total |     15165        100            
Differentiate number of employees in lignite mining and mining services in year 2015

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,544       37.93       37.93
 lignite mining |      9,074       62.07      100.00
----------------+-----------------------------------
          Total |     14,618      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5544   37.92584   37.92584 
lignite_mi~g |      9074   62.07416        100 
-------------+---------------------------------
       Total |     14618        100            
Differentiate number of employees in lignite mining and mining services in year 2016

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      5,347       38.17       38.17
 lignite mining |      8,663       61.83      100.00
----------------+-----------------------------------
          Total |     14,010      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      5347    38.1656    38.1656 
lignite_mi~g |      8663    61.8344        100 
-------------+---------------------------------
       Total |     14010        100            
Differentiate number of employees in lignite mining and mining services in year 2017

mining services |
   (1); lignite |
    mining (2); |
     other (0); |
    missing (.) |      Freq.     Percent        Cum.
----------------+-----------------------------------
mining services |      4,832       37.47       37.47
 lignite mining |      8,062       62.53      100.00
----------------+-----------------------------------
          Total |     12,894      100.00

thisspelllig |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
mining_ser~s |      4832   37.47479   37.47479 
lignite_mi~g |      8062   62.52521        100 
-------------+---------------------------------
       Total |     12894        100            
r; t=0.00 2:45:54

.         esttab y* using results/${samplefolder}/7b_empsector.csv, label plain replace
(file results/two/7b_empsector.csv not found)
(output written to results/two/7b_empsector.csv)
r; t=0.00 2:45:54

.         estimates clear
r; t=0.00 2:45:54

.         
. /* ------------------------------------------------------------------------ */
.  *      Figure 4 - Coal-mining retirement age across decades
. /* ------------------------------------------------------------------------ */  
.         forvalues t = 1/4 {
  2.                 di "Lignite employees' age at retirement for all mining areas by decade"
  3.                 tab agepotret if pretrans == 1 & decade == `t' & thisspelllignite == 1
  4.                 estpost tab agepotret if pretrans == 1 & decades == `t' & thisspelllignite == 1
  5.                 estimates store y`t'
  6.         }               
Lignite employees' age at retirement for all mining areas by decade
no observations

   agepotret |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
          50 |        NA   	  NA         NA 
          51 |        NA   	  NA         NA  
          52 |        NA   	  NA         NA 
          53 |        NA   	  NA         NA  
          54 |       142   2.498241   8.057706 
          55 |       347   6.104856   14.16256 
          56 |       282   4.961295   19.12386 
          57 |       310   5.453906   24.57776 
          58 |      1195   21.02393   45.60169 
          59 |       793   13.95144   59.55313 
          60 |      1235   21.72766   81.28079 
          61 |       211   3.712175   84.99296 
          62 |       143   2.515834    87.5088 
          63 |       567   9.975369   97.48417 
          64 |        NA   	  NA         NA  
          65 |        NA   	  NA         NA   
          66 |        NA   	  NA         NA 
          69 |        NA   	  NA         NA 
          75 |        NA   	  NA         NA 
          76 |        NA   	  NA         NA 
-------------+---------------------------------
       Total |      5684        100            
Lignite employees' age at retirement for all mining areas by decade
no observations

   agepotret |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
          50 |        NA   	  NA         NA  
          51 |        NA   	  NA         NA 
          52 |        NA   	  NA         NA  
          53 |        NA   	  NA         NA  
          54 |        NA   	  NA         NA 
          55 |       329   25.62305   38.86293 
          56 |       205   15.96573   54.82866 
          57 |       155   12.07165   66.90031 
          58 |        NA   	  NA         NA  
          59 |        NA   	  NA         NA  
          60 |       162   12.61682    84.7352 
          61 |        NA   	  NA         NA 
          62 |        NA   	  NA         NA  
          63 |        NA   	  NA         NA 
          64 |        NA   	  NA         NA  
          65 |        NA   	  NA         NA 
          66 |        NA   	  NA         NA  
          67 |        NA   	  NA         NA  
-------------+---------------------------------
       Total |      1284        100            
Lignite employees' age at retirement for all mining areas by decade
no observations

   agepotret |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
          50 |        NA   	  NA         NA  
          51 |        NA   	  NA         NA 
          52 |        NA   	  NA         NA  
          53 |        NA   	  NA         NA  
          54 |        NA   	  NA         NA 
          55 |        NA   	  NA         NA  
          56 |        NA   	  NA         NA  
          57 |       270   45.37815   51.76471 
          58 |       116    19.4958    71.2605 
          59 |        NA   	  NA         NA 
          60 |        NA   	  NA         NA 
          61 |        NA   	  NA         NA 
          62 |        NA   	  NA         NA 
          63 |        NA   	  NA         NA 
          64 |        NA   	  NA         NA 
          65 |        NA   	  NA         NA 
          67 |        NA   	  NA         NA 
          70 |        NA   	  NA         NA  
-------------+---------------------------------
       Total |       595        100            
Lignite employees' age at retirement for all mining areas by decade
no observations

   agepotret |      e(b)     e(pct)  e(cumpct) 
-------------+---------------------------------
          50 |        NA   	  NA         NA 
          51 |        NA   	  NA         NA 
          52 |        NA   	  NA         NA 
          53 |        NA   	  NA         NA 
          54 |        NA   	  NA         NA 
          55 |        NA   	  NA         NA 
          56 |        NA   	  NA         NA 
          57 |       179   9.521277   13.45745 
          58 |       463   24.62766   38.08511 
          59 |       379   20.15957   58.24468 
          60 |       254   13.51064   71.75532 
          61 |       122   6.489362   78.24468 
          62 |        NA   	  NA         NA 
          63 |       295   15.69149   95.58511 
          64 |        NA   	  NA         NA 
          65 |        NA   	  NA         NA 
          67 |        NA   	  NA         NA 
-------------+---------------------------------
       Total |      1880        100            
r; t=0.00 2:45:59

.         esttab y* using results/${samplefolder}/7b_ageret.csv, label plain replace
(file results/two/7b_ageret.csv not found)
(output written to results/two/7b_ageret.csv)
r; t=0.00 2:45:59

.         estimates clear
r; t=0.00 2:45:59

.         
. /* ------------------------------------------------------------------------ */
.  *      Figure 5 - Mean age of employees
. /* ------------------------------------------------------------------------ */  
.         forvalues i = 1/5 {
  2.                 forvalues t = 1975/$maxyear {
  3.                         cap drop age
  4.                         gen age = `t' - year(geb_dat)   
  5.                         cap drop area*meanage 
  6.                         cap egen area`i'meanage`t'=mean(age) if mdy(06,30,`t') >= begepi & mdy(06,30,`t') <= endepi & thisspelllignite == 1 & mining_area==`i'
  7.                         cap estimates store y`t'_`i'
  8.                 }
  9.         }
r; t=0.00 2:51:23

.         estpost sum area* 

             |  e(count)   e(sum_w)     e(sum)    e(mean)     e(Var)      e(sd)     e(min)     e(max) 
-------------+----------------------------------------------------------------------------------------
area1me~1975 |         0          0          0          .          .          .          .          . 
area1me~1976 |         0          0          0          .          .          .          .          . 
area1me~1977 |         0          0          0          .          .          .          .          . 
area1me~1978 |         0          0          0          .          .          .          .          . 
area1me~1979 |         0          0          0          .          .          .          .          . 
area1me~1980 |         0          0          0          .          .          .          .          . 
area1me~1981 |         0          0          0          .          .          .          .          . 
area1me~1982 |         0          0          0          .          .          .          .          . 
area1me~1983 |         0          0          0          .          .          .          .          . 
area1me~1984 |         0          0          0          .          .          .          .          . 
area1me~1985 |         0          0          0          .          .          .          .          . 
area1me~1986 |         0          0          0          .          .          .          .          . 
area1me~1987 |         0          0          0          .          .          .          .          . 
area1me~1988 |         0          0          0          .          .          .          .          . 
area1me~1989 |         0          0          0          .          .          .          .          . 
area1me~1990 |         0          0          0          .          .          .          .          . 
area1me~1991 |         0          0          0          .          .          .          .          . 
area1me~1992 |     47137      47137    1777874   37.71716          0          0   37.71716   37.71716 
area1me~1993 |     32429      32429    1281066   39.50372          0          0   39.50372   39.50372 
area1me~1994 |     23190      23190     952713   41.08292          0          0   41.08292   41.08292 
area1me~1995 |     20892      20892     894610    42.8207          0          0    42.8207    42.8207 
area1me~1996 |     15116      15116     627598   41.51879          0          0   41.51879   41.51879 
area1me~1997 |     12884      12884     547680   42.50854          0          0   42.50854   42.50854 
area1me~1998 |     10544      10544     445278   42.23046          0          0   42.23046   42.23046 
area1me~1999 |      8099       8099     330703   40.83257          0          0   40.83257   40.83257 
area1me~2000 |      7743       7743     323809   41.81958          0          0   41.81958   41.81958 
area1me~2001 |      7256       7256     309426   42.64416          0          0   42.64416   42.64416 
area1me~2002 |      7059       7059     306037   43.35416          0          0   43.35416   43.35416 
area1me~2003 |      6570       6570     290419    44.2038          0          0    44.2038    44.2038 
area1me~2004 |      6355       6355     281221   44.25193          0          0   44.25193   44.25193 
area1me~2005 |      6159       6159     271180   44.02988          0          0   44.02988   44.02988 
area1me~2006 |      5655       5655     247754   43.81149          0          0   43.81149   43.81149 
area1me~2007 |      5701       5701     248989   43.67462          0          0   43.67462   43.67462 
area1me~2008 |      5781       5781     254645   44.04861          0          0   44.04861   44.04861 
area1me~2009 |      5632       5632     249948   44.37997          0          0   44.37997   44.37997 
area1me~2010 |      5666       5666     255477   45.08948          0          0   45.08948   45.08948 
area1me~2011 |      5780       5780     262284   45.37785          0          0   45.37785   45.37785 
area1me~2012 |      5830       5830     267301   45.84923          0          0   45.84923   45.84923 
area1me~2013 |      5946       5946     275014   46.25193          0          0   46.25193   46.25193 
area1me~2014 |      5972       5972     277302   46.43369          0          0   46.43369   46.43369 
area1me~2015 |      5885       5885     273144   46.41359          0          0   46.41359   46.41359 
area1me~2016 |      5734       5734     263960   46.03418          0          0   46.03418   46.03418 
area1me~2017 |      5450       5450     250236   45.91486          0          0   45.91486   45.91486 
area2me~1975 |         0          0          0          .          .          .          .          . 
area2me~1976 |         0          0          0          .          .          .          .          . 
area2me~1977 |         0          0          0          .          .          .          .          . 
area2me~1978 |         0          0          0          .          .          .          .          . 
area2me~1979 |         0          0          0          .          .          .          .          . 
area2me~1980 |         0          0          0          .          .          .          .          . 
area2me~1981 |         0          0          0          .          .          .          .          . 
area2me~1982 |         0          0          0          .          .          .          .          . 
area2me~1983 |         0          0          0          .          .          .          .          . 
area2me~1984 |         0          0          0          .          .          .          .          . 
area2me~1985 |         0          0          0          .          .          .          .          . 
area2me~1986 |         0          0          0          .          .          .          .          . 
area2me~1987 |         0          0          0          .          .          .          .          . 
area2me~1988 |         0          0          0          .          .          .          .          . 
area2me~1989 |         0          0          0          .          .          .          .          . 
area2me~1990 |         0          0          0          .          .          .          .          . 
area2me~1991 |         0          0          0          .          .          .          .          . 
area2me~1992 |     26554      26554    1018538   38.35723          0          0   38.35723   38.35723 
area2me~1993 |     18649      18649     751983   40.32297          0          0   40.32297   40.32297 
area2me~1994 |     14070      14070     585098   41.58479          0          0   41.58479   41.58479 
area2me~1995 |     12988      12988     558756   43.02094          0          0   43.02094   43.02094 
area2me~1996 |      9258       9258     414617   44.78473          0          0   44.78473   44.78473 
area2me~1997 |      6251       6251     275040   43.99936          0          0   43.99936   43.99936 
area2me~1998 |      4802       4802     209598   43.64806          0          0   43.64806   43.64806 
area2me~1999 |      3741       3741     162570    43.4563          0          0    43.4563    43.4563 
area2me~2000 |      3639       3639     160161   44.01237          0          0   44.01237   44.01237 
area2me~2001 |      2891       2891     127767   44.19474          0          0   44.19474   44.19474 
area2me~2002 |      2864       2864     128291   44.79434          0          0   44.79434   44.79434 
area2me~2003 |      2761       2761     123587   44.76168          0          0   44.76168   44.76168 
area2me~2004 |      2676       2676     120206   44.92003          0          0   44.92003   44.92003 
area2me~2005 |      2620       2620     118929   45.39275          0          0   45.39275   45.39275 
area2me~2006 |      2613       2613     119915    45.8917          0          0    45.8917    45.8917 
area2me~2007 |      2583       2583     117940   45.66008          0          0   45.66008   45.66008 
area2me~2008 |      2549       2549     117391   46.05375          0          0   46.05375   46.05375 
area2me~2009 |      2520       2520     117171   46.49643          0          0   46.49643   46.49643 
area2me~2010 |      2459       2459     114847   46.70476          0          0   46.70476   46.70476 
area2me~2011 |      2494       2494     116867   46.85926          0          0   46.85926   46.85926 
area2me~2012 |      2435       2435     114239    46.9154          0          0    46.9154    46.9154 
area2me~2013 |      2313       2313     108182   46.77129          0          0   46.77129   46.77129 
area2me~2014 |      2327       2327     108232   46.51139          0          0   46.51139   46.51139 
area2me~2015 |      2330       2330     107520   46.14592          0          0   46.14592   46.14592 
area2me~2016 |      2240       2240     101842   45.46518          0          0   45.46518   45.46518 
area2me~2017 |      2068       2068      93075   45.00725          0          0   45.00725   45.00725 
area3me~1975 |      3233       3233     142302   44.01546          0          0   44.01546   44.01546 
area3me~1976 |      3257       3257     143945   44.19558          0          0   44.19558   44.19558 
area3me~1977 |      3202       3202     142059   44.36571          0          0   44.36571   44.36571 
area3me~1978 |      3131       3131     139757   44.63654          0          0   44.63654   44.63654 
area3me~1979 |      3170       3170     140008   44.16656          0          0   44.16656   44.16656 
area3me~1980 |      3246       3246     141150   43.48429          0          0   43.48429   43.48429 
area3me~1981 |      3295       3295     140910   42.76479          0          0   42.76479   42.76479 
area3me~1982 |      3378       3378     142480    42.1788          0          0    42.1788    42.1788 
area3me~1983 |      3351       3351     141467   42.21635          0          0   42.21635   42.21635 
area3me~1984 |      3320       3320     140158   42.21627          0          0   42.21627   42.21627 
area3me~1985 |      3192       3192     134239   42.05482          0          0   42.05482   42.05482 
area3me~1986 |      3084       3084     127145    41.2273          0          0    41.2273    41.2273 
area3me~1987 |      3109       3109     127322   40.95272          0          0   40.95272   40.95272 
area3me~1988 |      2921       2921     117528   40.23553          0          0   40.23553   40.23553 
area3me~1989 |      2708       2708     107529    39.7079          0          0    39.7079    39.7079 
area3me~1990 |      2627       2627     106160   40.41111          0          0   40.41111   40.41111 
area3me~1991 |      2578       2578     105971    41.1059          0          0    41.1059    41.1059 
area3me~1992 |      2470       2470     101901   41.25547          0          0   41.25547   41.25547 
area3me~1993 |      2149       2149      86999   40.48348          0          0   40.48348   40.48348 
area3me~1994 |      1904       1904      74642   39.20273          0          0   39.20273   39.20273 
area3me~1995 |      1797       1797      70126   39.02393          0          0   39.02393   39.02393 
area3me~1996 |      1723       1723      67720   39.30354          0          0   39.30354   39.30354 
area3me~1997 |      1637       1637      63868   39.01527          0          0   39.01527   39.01527 
area3me~1998 |      1710       1710      68603   40.11871          0          0   40.11871   40.11871 
area3me~1999 |      1526       1526      62085    40.6848          0          0    40.6848    40.6848 
area3me~2000 |      1484       1484      61688   41.56873          0          0   41.56873   41.56873 
area3me~2001 |      1397       1397      59330   42.46958          0          0   42.46958   42.46958 
area3me~2002 |      1265       1265      54437    43.0332          0          0    43.0332    43.0332 
area3me~2003 |      1107       1107      48213   43.55285          0          0   43.55285   43.55285 
area3me~2004 |      1037       1037      45523   43.89875          0          0   43.89875   43.89875 
area3me~2005 |       899        899      39348   43.76863          0          0   43.76863   43.76863 
area3me~2006 |       862        862      37717   43.75522          0          0   43.75522   43.75522 
area3me~2007 |       860        860      38119   44.32442          0          0   44.32442   44.32442 
area3me~2008 |       719        719      32769    45.5758          0          0    45.5758    45.5758 
area3me~2009 |       714        714      33211     46.514          0          0     46.514     46.514 
area3me~2010 |       703        703      33192   47.21479          0          0   47.21479   47.21479 
area3me~2011 |       739        739      34624    46.8525          0          0    46.8525    46.8525 
area3me~2012 |       730        730      34870   47.76712          0          0   47.76712   47.76712 
area3me~2013 |       726        726      34909   48.08402          0          0   48.08402   48.08402 
area3me~2014 |       251        251      11940   47.56972          0          0   47.56972   47.56972 
area3me~2015 |       221        221      10343    46.8009          0          0    46.8009    46.8009 
area3me~2016 |       193        193       8805   45.62176          0          0   45.62176   45.62176 
area3me~2017 |       189        189       8385   44.36508          0          0   44.36508   44.36508 
area4me~1975 |     15023      15023     633283   42.15423          0          0   42.15423   42.15423 
area4me~1976 |     15305      15305     641662   41.92499          0          0   41.92499   41.92499 
area4me~1977 |     15278      15278     637853   41.74977          0          0   41.74977   41.74977 
area4me~1978 |     13636      13636     564545   41.40107          0          0   41.40107   41.40107 
area4me~1979 |     14146      14146     576503   40.75378          0          0   40.75378   40.75378 
area4me~1980 |     14864      14864     595071   40.03438          0          0   40.03438   40.03438 
area4me~1981 |     15280      15280     605332   39.61597          0          0   39.61597   39.61597 
area4me~1982 |     15962      15962     623538    39.0639          0          0    39.0639    39.0639 
area4me~1983 |     15871      15871     623065   39.25808          0          0   39.25808   39.25808 
area4me~1984 |     15862      15862     621906   39.20729          0          0   39.20729   39.20729 
area4me~1985 |     15707      15707     607943   38.70523          0          0   38.70523   38.70523 
area4me~1986 |     15627      15627     601501   38.49114          0          0   38.49114   38.49114 
area4me~1987 |     15681      15681     607984   38.77202          0          0   38.77202   38.77202 
area4me~1988 |     15324      15324     597616    38.9987          0          0    38.9987    38.9987 
area4me~1989 |     14170      14170     548183   38.68617          0          0   38.68617   38.68617 
area4me~1990 |     14123      14123     547345   38.75558          0          0   38.75558   38.75558 
area4me~1991 |     14034      14034     544216    38.7784          0          0    38.7784    38.7784 
area4me~1992 |     13458      13458     517395   38.44516          0          0   38.44516   38.44516 
area4me~1993 |     12535      12535     475389   37.92493          0          0   37.92493   37.92493 
area4me~1994 |     11801      11801     450518   38.17626          0          0   38.17626   38.17626 
area4me~1995 |     10965      10965     414027   37.75896          0          0   37.75896   37.75896 
area4me~1996 |     10533      10533     399798   37.95671          0          0   37.95671   37.95671 
area4me~1997 |     10100      10100     385466   38.16495          0          0   38.16495   38.16495 
area4me~1998 |     10843      10843     427677   39.44268          0          0   39.44268   39.44268 
area4me~1999 |     10388      10388     418066   40.24509          0          0   40.24509   40.24509 
area4me~2000 |     10197      10197     414995   40.69775          0          0   40.69775   40.69775 
area4me~2001 |      9047       9047     367536   40.62518          0          0   40.62518   40.62518 
area4me~2002 |      8577       8577     350126    40.8215          0          0    40.8215    40.8215 
area4me~2003 |      8238       8238     340437    41.3252          0          0    41.3252    41.3252 
area4me~2004 |      6916       6916     287711   41.60078          0          0   41.60078   41.60078 
area4me~2005 |      6574       6574     277236   42.17159          0          0   42.17159   42.17159 
area4me~2006 |      6361       6361     273369   42.97579          0          0   42.97579   42.97579 
area4me~2007 |      6839       6839     299920   43.85437          0          0   43.85437   43.85437 
area4me~2008 |      6887       6887     305540   44.36475          0          0   44.36475   44.36475 
area4me~2009 |      6823       6823     305551    44.7825          0          0    44.7825    44.7825 
area4me~2010 |      6848       6848     311215   45.44612          0          0   45.44612   45.44612 
area4me~2011 |      6853       6853     315677   46.06406          0          0   46.06406   46.06406 
area4me~2012 |      6699       6699     312245   46.61069          0          0   46.61069   46.61069 
area4me~2013 |      6600       6600     310425   47.03409          0          0   47.03409   47.03409 
area4me~2014 |      6436       6436     307117   47.71861          0          0   47.71861   47.71861 
area4me~2015 |      6001       6001     288672   48.10398          0          0   48.10398   48.10398 
area4me~2016 |      5651       5651     274598   48.59282          0          0   48.59282   48.59282 
area4me~2017 |      5007       5007     245988   49.12882          0          0   49.12882   49.12882 
area5me~1975 |      2984       2984     126772   42.48391          0          0   42.48391   42.48391 
area5me~1976 |      3062       3062     130238   42.53364          0          0   42.53364   42.53364 
area5me~1977 |      2968       2968     127949    43.1095          0          0    43.1095    43.1095 
area5me~1978 |      2919       2919     126945   43.48921          0          0   43.48921   43.48921 
area5me~1979 |      2769       2769     122094   44.09317          0          0   44.09317   44.09317 
area5me~1980 |      2563       2563     113483   44.27741          0          0   44.27741   44.27741 
area5me~1981 |      2330       2330     103493   44.41759          0          0   44.41759   44.41759 
area5me~1982 |      2162       2162      96281    44.5333          0          0    44.5333    44.5333 
area5me~1983 |      1495       1495      66004   44.14983          0          0   44.14983   44.14983 
area5me~1984 |      1320       1320      58031   43.96288          0          0   43.96288   43.96288 
area5me~1985 |      1237       1237      54083    43.7211          0          0    43.7211    43.7211 
area5me~1986 |      1187       1187      52059   43.85762          0          0   43.85762   43.85762 
area5me~1987 |      1092       1092      48225   44.16209          0          0   44.16209   44.16209 
area5me~1988 |       952        952      42186   44.31303          0          0   44.31303   44.31303 
area5me~1989 |       802        802      35419   44.16334          0          0   44.16334   44.16334 
area5me~1990 |       638        638      28492   44.65831          0          0   44.65831   44.65831 
area5me~1991 |       508        508      22868   45.01575          0          0   45.01575   45.01575 
area5me~1992 |       217        217      10117   46.62212          0          0   46.62212   46.62212 
area5me~1993 |       159        159       7286    45.8239          0          0    45.8239    45.8239 
area5me~1994 |       122        122       5326   43.65574          0          0   43.65574   43.65574 
area5me~1995 |       106        106       4450   41.98113          0          0   41.98113   41.98113 
area5me~1996 |        NA         NA         NA         NA         NA         NA         NA         NA 
area5me~1997 |        NA         NA         NA         NA         NA         NA         NA         NA
area5me~1998 |        NA         NA         NA         NA         NA         NA         NA         NA
area5me~1999 |        NA         NA         NA         NA         NA         NA         NA         NA
area5me~2000 |       110        110       4937   44.88182          0          0   44.88182   44.88182 
area5me~2001 |       114        114       5160   45.26316          0          0   45.26316   45.26316 
area5me~2002 |       168        168       7424   44.19048          0          0   44.19048   44.19048 
area5me~2003 |       425        425      18272   42.99294          0          0   42.99294   42.99294 
area5me~2004 |       398        398      17514   44.00502          0          0   44.00502   44.00502 
area5me~2005 |       396        396      17463   44.09848          0          0   44.09848   44.09848 
area5me~2006 |       369        369      16536   44.81301          0          0   44.81301   44.81301 
area5me~2007 |       256        256      12310   48.08594          0          0   48.08594   48.08594 
area5me~2008 |       236        236      11344   48.06779          0          0   48.06779   48.06779 
area5me~2009 |       203        203       9578   47.18227          0          0   47.18227   47.18227 
area5me~2010 |       184        184       8513    46.2663          0          0    46.2663    46.2663 
area5me~2011 |       180        180       8253      45.85          0          0      45.85      45.85 
area5me~2012 |       172        172       7844   45.60465          0          0   45.60465   45.60465 
area5me~2013 |       180        180       8000   44.44444          0          0   44.44444   44.44444 
area5me~2014 |       179        179       8103   45.26816          0          0   45.26816   45.26816 
area5me~2015 |       181        181       8220   45.41436          0          0   45.41436   45.41436 
area5me~2016 |       192        192       8789   45.77604          0          0   45.77604   45.77604 
area5me~2017 |       180        180       8454   46.96667          0          0   46.96667   46.96667 
r; t=0.00 2:53:41

.         
.         esttab using results/${samplefolder}/7b_meanage.csv, cells("mean")  nomtitle nonumber append
(file results/two/7b_meanage.csv not found)
(output written to results/two/7b_meanage.csv)
r; t=0.00 2:53:41

.         estimates clear
r; t=0.00 2:53:41

. 
.         
. /* ------------------------------------------------------------------------ */
.  *      Export output in one excel file
. /* ------------------------------------------------------------------------ */  
.         preserve
r; t=0.00 2:53:44

.                 import delimited using results/${samplefolder}/7b_empareas.csv,  stripquotes(yes) delimiters(",") bindquotes(nobind) clear
(44 vars, 21 obs)
r; t=0.00 2:53:45

.                 export excel using results/${samplefolder}/7b_BiocoalFiguresForPaper.xlsx, sheet("empareas") replace
file results/two/7b_BiocoalFiguresForPaper.xlsx saved
r; t=0.00 2:53:45

.                 import delimited using results/${samplefolder}/7b_empsector.csv,  stripquotes(yes) delimiters("=") bindquotes(nobind)  varnames(1) clear
(1 var, 8 obs)
r; t=0.00 2:53:45

.                 export excel using results/${samplefolder}/7b_BiocoalFiguresForPaper.xlsx, sheet("empsector") sheetmodify       
file results/two/7b_BiocoalFiguresForPaper.xlsx saved
r; t=0.00 2:53:45

.                 import delimited using results/${samplefolder}/7b_ageret.csv,  stripquotes(yes) delimiters(",") bindquotes(nobind) clear
(5 vars, 49 obs)
r; t=0.00 2:53:45

.                 export excel using results/${samplefolder}/7b_BiocoalFiguresForPaper.xlsx, sheet("ageret") sheetmodify
file results/two/7b_BiocoalFiguresForPaper.xlsx saved
r; t=0.00 2:53:45

.                 import delimited using results/${samplefolder}/7b_meanage.csv,  stripquotes(yes) delimiters(",") bindquotes(nobind) clear
(2 vars, 217 obs)
r; t=0.00 2:53:45

.                 export excel using results/${samplefolder}/7b_BiocoalFiguresForPaper.xlsx, sheet("meanage") sheetmodify
file results/two/7b_BiocoalFiguresForPaper.xlsx saved
r; t=0.00 2:53:45

.         restore 
r; t=0.00 2:53:48

.         
. * ------------------------------------------------------------------------ *
. *  Table 1 - Comparing descriptive stats across samples
. * ------------------------------------------------------------------------ *    
. 
. ******************************************************************
. ***  We have three datasets:
. ** (a) Whole sample = precoll (already loaded here)
. ** (b) precoll but only coal workers
. ** (c) wage sample used to calculate wcoal
. ** (d) wage sample used to calculate wnc
. ***  => report descriptive statistics for three datasets ***
. *********************************************************
. save delme, replace
(file delme.dta not found)
file delme.dta saved
r; t=0.00 2:54:41

. 
. * New JAERE August 2022 - distinction between the two wage samples used to 
. * calculate wcoal and wnc - hoping that the descriptives are very similar
. 
. local i = 1
r; t=0.00 2:54:41

. while `i' < 5 { 
  2. if i==1
  3. *first run descriptive: run analysis on data already loaded
. disp("first column: whole sample")
  4. 
. if `i'==2{
  5. * if i=2, second run: only coal spells
. * reload dataset to generate newly the macro conditions of coal spells
. disp("second column: only coal spells")
  6. use ${data}/precoll.dta, clear
  7. drop if thisspelllignite==0
  8. }
  9. 
. if `i'==3{
 10. * if i=3, third run: only sample used to calculate coal wage distribution
.         if ${sample}<7{
 11.                 use ${data}\wage_sample_wcoal_estimation.dta, clear
 12.         }
 13.         if ${sample}==7{
 14.                 use ${data}\wage_sample7_wcoal_estimation.dta, clear    
 15.                 }
 16.         if ${sample}==8{
 17.                 use ${data}\wage_sample8_wcoal_estimation.dta, clear
 18.         }
 19.         if ${sample}==9{
 20.                 use ${data}\wage_sample9_wcoal_estimation.dta, clear
 21.         }
 22. 
. disp("second column: only wage spells used for coal wage distribution")
 23. keep if (wcoal_end_monthly==.)
 24. }
 25. 
. if `i'==4{
 26. * if i=4, fourth run: only sample used to calculate non-coal wage distribution
. use ${data}\wage_sample_wnc_estimation.dta, clear
 27. disp("second column: only wage spells used for non-coal wage distribution")
 28. keep if (wcoal_end_monthly==. | wnc_offer_tentg_beg==.)
 29. }
 30. *** (!) total number of spells / number of lignite spells / size wage sample
. disp("total number of spells")
 31. count
 32. 
. *** (!) count how many individuals contribute to estimation
. g delfirstpid=.
 33. bys pid: replace delfirstpid=(_n==1)
 34. disp("distinct individuals contributing to estimation")
 35. count if (delfirstpid==1)
 36. drop delfirstpid
 37. 
. *** Define variables for descriptive statistics
. 
.         * (6.1) Categorical age variable agecat2 already defined
.         
.         * (6.2) Define categorical edu variable
.                         * g educat2=. 
.                         * replace educat2 = 1 if bild==1
.                         * replace educat2 = 2 if (bild==2 | bild ==3)
.                         
.         * (6.3) Create resid_area as generalisation of mining area for non-coal jobs
.                         cap drop livarea
 38.                         g livarea=.
 39.                         * Mining Area 1: Lausitz
.                         replace livarea = 1 if ao_kreis == 12052 // Stadt Cottbus (Brandenburg)
 40.                         replace livarea = 1 if ao_kreis == 12061 // LK Dahme-Spreewald (Brandenburg)
 41.                         replace livarea = 1 if ao_kreis == 12062 // LK Elbe-Elster (Brandenburg)
 42.                         replace livarea = 1 if ao_kreis == 12066 // LK Oberspreewald-Lausitz (Brandenburg)
 43.                         replace livarea = 1 if ao_kreis == 12071 // LK Spree-Neisse (Brandenburg)
 44.                         replace livarea = 1 if ao_kreis == 14625 // LK Bautzen (Sachsen)
 45.                         replace livarea = 1 if ao_kreis == 14626 // LK Goerlitz (Sachsen)
 46.                         * Mining Area 2: Mitteldeutsches Revier
.                         replace livarea = 2 if ao_kreis == 14713 // Stadt Leipzig (Sachsen)
 47.                         replace livarea = 2 if ao_kreis == 14729 // LK Leipzig (Sachsen)
 48.                         replace livarea = 2 if ao_kreis == 14730 // LK Nordsachsen (Sachsen)
 49.                         replace livarea = 2 if ao_kreis == 15002 // Stadt Halle(Saale)
 50.                         replace livarea = 2 if ao_kreis == 15082 // LK Anhalt-Bitterfeld (Sachsen-Anhalt)
 51.                         replace livarea = 2 if ao_kreis == 15084 // LK Burgenlandkreis (Sachsen-Anhalt)
 52.                         replace livarea = 2 if ao_kreis == 15087 // LK Mansfeld-Südharz (Sachsen-Anhalt)
 53.                         replace livarea = 2 if ao_kreis == 15088 // LK Saalekreis (Sachsen-Anhalt)
 54.                         replace livarea = 2 if ao_kreis == 15091 // LK Wittenberg (Sachsen-Anhalt)
 55.                         replace livarea = 2 if ao_kreis == 16077 // LK Altenburger Land (Thüringen)
 56.                         replace livarea = 2 if ao_kreis == 16075 // LK Saale-Orla-Kreis (Thüringen)
 57.                         * Mining Area 3: Rheinisches Revier
.                         replace livarea = 3 if ao_kreis == 05112 // Stadt Duisburg (NRW)
 58.                         replace livarea = 3 if ao_kreis == 05162 // LK Rhein-Kreis Neuss (NRW)
 59.                         replace livarea = 3 if ao_kreis == 05315 // Stadt Köln (NRW)
 60.                         replace livarea = 3 if ao_kreis == 05334 // LK Städteregion Aachen (NRW)
 61.                         replace livarea = 3 if ao_kreis == 05362 // LK Rhein-Erft-Kreis (NRW)
 62.                         replace livarea = 3 if ao_kreis == 05358 // LK Düren (NRW)
 63.                         replace livarea = 3 if ao_kreis == 05366 // LK Euskirchen (NRW)
 64.                         * Mining Area 4: Other Coal areas - (first two are Helmstedter Revier)
.                         replace livarea = 4 if ao_kreis == 03154 // LK Helmstedt (Niedersachsen)
 65.                         replace livarea = 4 if ao_kreis == 15083 // LK Börde (Sachsen-Anhalt)
 66.                         replace livarea = 4 if ao_kreis == 03153 // LK Goslar
 67.                         replace livarea = 4 if ao_kreis == 03241 // Region Hannover
 68.                         replace livarea = 4 if ao_kreis == 05570 // LK Warendorf
 69.                         replace livarea = 4 if ao_kreis == 06440 // LK Wetteraukreis
 70.                         replace livarea = 4 if ao_kreis == 06611 // Stadt Kassel
 71.                         replace livarea = 4 if ao_kreis == 06634 // LK Schwalm-Eder-Kreis
 72.                         replace livarea = 4 if ao_kreis == 06636 // LK Werra-Meißner-Kreis
 73.                         replace livarea = 4 if ao_kreis == 09162 // Stadt München
 74.                         replace livarea = 4 if ao_kreis == 09376 // LK Schwandorf
 75.                         replace livarea = 4 if ao_kreis == 09672 // LK Bad Kissingen
 76.                         replace livarea = 4 if ao_kreis == 10041 // Regionalverband Saarbrücken
 77.                         replace livarea = 4 if ao_kreis == 10044 // LK Saarlouis
 78.                         replace livarea = 4 if ao_kreis == 11000 // Stadt Berlin
 79.                         replace livarea = 4 if ao_kreis == 13073 // LK Vorpommern-Rügen
 80.                         replace livarea = 4 if ao_kreis == 14521 // LK Erzgebirgskreis  
 81.                         * Non-Mining Areas 5: Other undefined Reviere
.                         replace livarea = 5 if livarea == . & ao_kreis !=.
 82.                         label define livareas 1 "Lusatia" 2 "Central Germany" 3 "Rhineland" 4 "Other coal area" 5 "Other non-coal areas"
 83.                         label val livarea areas
 84. 
.         * (6.4) Create macroeconomic conditions
. 
.         * Note that the cell-based approach first cuts spells which span
.         * across different macroeconomic conditions. 
.         * Here we do not do this.
.                         
.                 g macro=.
 85. 
.                 * bad macro conditions = 1 / good macro conditions = 2
.                 * approximations here
.                 * (1) good macro is less than 10% unemployment
.                 * (2)   Lausitz:    from (incl) 2015-
.                 *               Rheinisches from (incl) 2007 -
.                 *       Helmstedter from (incl) 2008 - 
.                 *               Mitteldeutsches from (incl) 2016 -
.                 replace macro=1 if mining_area== 1 & endepi<mdy(01,01,2015)
 86.                 replace macro=1 if mining_area== 2 & endepi<mdy(01,01,2016)
 87.                 replace macro=1 if mining_area== 3 & endepi<mdy(01,01,2008)
 88.                 replace macro=1 if mining_area== 4 & endepi<mdy(01,01,2007)
 89.                 
.                 replace macro=2 if mining_area== 1 & endepi>=mdy(01,01,2015)
 90.                 replace macro=2 if mining_area== 2 & endepi>=mdy(01,01,2016)
 91.                 replace macro=2 if mining_area== 3 & endepi>=mdy(01,01,2008)
 92.                 replace macro=2 if mining_area== 4 & endepi>=mdy(01,01,2007)
 93. 
.                 * West-Germany: Unemployment below 10% in all years since 1990 
.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula<12
 94. 
.                 * East Germany: Unemployment below 10% for women since 2012, for men since 2015 
.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2012) & frau==1
 95.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2014) & frau==0
 96.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2012) & frau==1
 97.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2014) & frau==0
 98.                 cap label drop macroLAB
 99.                 label define macroLAB 1 "hi-unemp" 2 "lo-unemp" 
100.                 label values macro macroLAB
101. 
. * produce tables of the descriptive stats for the three datasets
. 
. tab agecat2,m
102. tab frau,m
103. tab educ2,m
104. tab livarea, m
105. tab macro,m
106. tab status, m
107. tab beruf12, m
108. 
. **********************************************************************
. ******
. * JAERE December 2022 - industry sectors after coal
. * => see 5estimations section (2); section (9.5.1)
. 
.         * JAERE - R2.MC7 - Distribution of length of spells in lignite
.         * new january 2023
.         disp("distribution of durations of this sample")
109.         su dur, det
110.         disp("distribution of durations in lignite of this sample")
111.         su dur if thisspelllignite==1, det
112.         disp("distribution of durations in lignite & statsimple==1 of this sample")
113.         su dur if thisspelllignite==1 & statsimple==1, det
114.         disp("")
115.         su dur if thisspelllignite==0 & statsimple==1, det
116. 
.         * test the specific criterion for inclusion 6 months in lignite mining
.         count if dur<=180 
117.         * distributions for durations below 3651 days
.         *                       below 1000 days, below 500 days, below 365 days
. 
. local durations 181 366 500 1000 3700 7300
118. foreach d of local durations {
119.                 cap histogram dur if statsimple==1 & dur<=`d'
120.                 cap graph save dur`d'sample${sample}run`i'.gph, replace
121.                 cap graph export dur`d'sample${sample}run`i'.png, replace
122.         }
123.         
. **********************************************************************
. local i = `i' + 1
124. }               
i ambiguous abbreviation
r(111); t=0.00 2:54:41

end of do-file
r(111); t=0.00 2:54:41

end of do-file

r(111); t=0.00 2:54:41

. do "C:\Users\JanserM\AppData\Local\Temp\18\STD6cf8_000000.tmp"

. local i = 1
r; t=0.00 9:07:05

. while `i' < 5 { 
  2. if `i'==1
  3. *first run descriptive: run analysis on data already loaded
. disp("first column: whole sample")
  4. 
. if `i'==2{
  5. * if i=2, second run: only coal spells
. * reload dataset to generate newly the macro conditions of coal spells
. disp("second column: only coal spells")
  6. use ${data}/precoll.dta, clear
  7. drop if thisspelllignite==0
  8. }
  9. 
. if `i'==3{
 10. * if i=3, third run: only sample used to calculate coal wage distribution
.         if ${sample}<7{
 11.                 use ${data}\wage_sample_wcoal_estimation.dta, clear
 12.         }
 13.         if ${sample}==7{
 14.                 use ${data}\wage_sample7_wcoal_estimation.dta, clear    
 15.                 }
 16.         if ${sample}==8{
 17.                 use ${data}\wage_sample8_wcoal_estimation.dta, clear
 18.         }
 19.         if ${sample}==9{
 20.                 use ${data}\wage_sample9_wcoal_estimation.dta, clear
 21.         }
 22. 
. disp("second column: only wage spells used for coal wage distribution")
 23. keep if (wcoal_end_monthly==.)
 24. }
 25. 
. if `i'==4{
 26. * if i=4, fourth run: only sample used to calculate non-coal wage distribution
. use ${data}\wage_sample_wnc_estimation.dta, clear
 27. disp("second column: only wage spells used for non-coal wage distribution")
 28. keep if (wcoal_end_monthly==. | wnc_offer_tentg_beg==.)
 29. }
 30. *** (!) total number of spells / number of lignite spells / size wage sample
. disp("total number of spells")
 31. count
 32. 
. *** (!) count how many individuals contribute to estimation
. g delfirstpid=.
 33. bys pid: replace delfirstpid=(_n==1)
 34. disp("distinct individuals contributing to estimation")
 35. count if (delfirstpid==1)
 36. drop delfirstpid
 37. 
. *** Define variables for descriptive statistics
. 
.         * (6.1) Categorical age variable agecat2 already defined
.         
.         * (6.2) Define categorical edu variable
.                         * g educat2=. 
.                         * replace educat2 = 1 if bild==1
.                         * replace educat2 = 2 if (bild==2 | bild ==3)
.                         
.         * (6.3) Create resid_area as generalisation of mining area for non-coal jobs
.                         cap drop livarea
 38.                         g livarea=.
 39.                         * Mining Area 1: Lausitz
.                         replace livarea = 1 if ao_kreis == 12052 // Stadt Cottbus (Brandenburg)
 40.                         replace livarea = 1 if ao_kreis == 12061 // LK Dahme-Spreewald (Brandenburg)
 41.                         replace livarea = 1 if ao_kreis == 12062 // LK Elbe-Elster (Brandenburg)
 42.                         replace livarea = 1 if ao_kreis == 12066 // LK Oberspreewald-Lausitz (Brandenburg)
 43.                         replace livarea = 1 if ao_kreis == 12071 // LK Spree-Neisse (Brandenburg)
 44.                         replace livarea = 1 if ao_kreis == 14625 // LK Bautzen (Sachsen)
 45.                         replace livarea = 1 if ao_kreis == 14626 // LK Goerlitz (Sachsen)
 46.                         * Mining Area 2: Mitteldeutsches Revier
.                         replace livarea = 2 if ao_kreis == 14713 // Stadt Leipzig (Sachsen)
 47.                         replace livarea = 2 if ao_kreis == 14729 // LK Leipzig (Sachsen)
 48.                         replace livarea = 2 if ao_kreis == 14730 // LK Nordsachsen (Sachsen)
 49.                         replace livarea = 2 if ao_kreis == 15002 // Stadt Halle(Saale)
 50.                         replace livarea = 2 if ao_kreis == 15082 // LK Anhalt-Bitterfeld (Sachsen-Anhalt)
 51.                         replace livarea = 2 if ao_kreis == 15084 // LK Burgenlandkreis (Sachsen-Anhalt)
 52.                         replace livarea = 2 if ao_kreis == 15087 // LK Mansfeld-Südharz (Sachsen-Anhalt)
 53.                         replace livarea = 2 if ao_kreis == 15088 // LK Saalekreis (Sachsen-Anhalt)
 54.                         replace livarea = 2 if ao_kreis == 15091 // LK Wittenberg (Sachsen-Anhalt)
 55.                         replace livarea = 2 if ao_kreis == 16077 // LK Altenburger Land (Thüringen)
 56.                         replace livarea = 2 if ao_kreis == 16075 // LK Saale-Orla-Kreis (Thüringen)
 57.                         * Mining Area 3: Rheinisches Revier
.                         replace livarea = 3 if ao_kreis == 05112 // Stadt Duisburg (NRW)
 58.                         replace livarea = 3 if ao_kreis == 05162 // LK Rhein-Kreis Neuss (NRW)
 59.                         replace livarea = 3 if ao_kreis == 05315 // Stadt Köln (NRW)
 60.                         replace livarea = 3 if ao_kreis == 05334 // LK Städteregion Aachen (NRW)
 61.                         replace livarea = 3 if ao_kreis == 05362 // LK Rhein-Erft-Kreis (NRW)
 62.                         replace livarea = 3 if ao_kreis == 05358 // LK Düren (NRW)
 63.                         replace livarea = 3 if ao_kreis == 05366 // LK Euskirchen (NRW)
 64.                         * Mining Area 4: Other Coal areas - (first two are Helmstedter Revier)
.                         replace livarea = 4 if ao_kreis == 03154 // LK Helmstedt (Niedersachsen)
 65.                         replace livarea = 4 if ao_kreis == 15083 // LK Börde (Sachsen-Anhalt)
 66.                         replace livarea = 4 if ao_kreis == 03153 // LK Goslar
 67.                         replace livarea = 4 if ao_kreis == 03241 // Region Hannover
 68.                         replace livarea = 4 if ao_kreis == 05570 // LK Warendorf
 69.                         replace livarea = 4 if ao_kreis == 06440 // LK Wetteraukreis
 70.                         replace livarea = 4 if ao_kreis == 06611 // Stadt Kassel
 71.                         replace livarea = 4 if ao_kreis == 06634 // LK Schwalm-Eder-Kreis
 72.                         replace livarea = 4 if ao_kreis == 06636 // LK Werra-Meißner-Kreis
 73.                         replace livarea = 4 if ao_kreis == 09162 // Stadt München
 74.                         replace livarea = 4 if ao_kreis == 09376 // LK Schwandorf
 75.                         replace livarea = 4 if ao_kreis == 09672 // LK Bad Kissingen
 76.                         replace livarea = 4 if ao_kreis == 10041 // Regionalverband Saarbrücken
 77.                         replace livarea = 4 if ao_kreis == 10044 // LK Saarlouis
 78.                         replace livarea = 4 if ao_kreis == 11000 // Stadt Berlin
 79.                         replace livarea = 4 if ao_kreis == 13073 // LK Vorpommern-Rügen
 80.                         replace livarea = 4 if ao_kreis == 14521 // LK Erzgebirgskreis  
 81.                         * Non-Mining Areas 5: Other undefined Reviere
.                         replace livarea = 5 if livarea == . & ao_kreis !=.
 82.                         label define livareas 1 "Lusatia" 2 "Central Germany" 3 "Rhineland" 4 "Other coal area" 5 "Other non-coa
> l areas"
 83.                         label val livarea areas
 84. 
.         * (6.4) Create macroeconomic conditions
. 
.         * Note that the cell-based approach first cuts spells which span
.         * across different macroeconomic conditions. 
.         * Here we do not do this.
.                         
.                 g macro=.
 85. 
.                 * bad macro conditions = 1 / good macro conditions = 2
.                 * approximations here
.                 * (1) good macro is less than 10% unemployment
.                 * (2)   Lausitz:    from (incl) 2015-
.                 *               Rheinisches from (incl) 2007 -
.                 *       Helmstedter from (incl) 2008 - 
.                 *               Mitteldeutsches from (incl) 2016 -
.                 replace macro=1 if mining_area== 1 & endepi<mdy(01,01,2015)
 86.                 replace macro=1 if mining_area== 2 & endepi<mdy(01,01,2016)
 87.                 replace macro=1 if mining_area== 3 & endepi<mdy(01,01,2008)
 88.                 replace macro=1 if mining_area== 4 & endepi<mdy(01,01,2007)
 89.                 
.                 replace macro=2 if mining_area== 1 & endepi>=mdy(01,01,2015)
 90.                 replace macro=2 if mining_area== 2 & endepi>=mdy(01,01,2016)
 91.                 replace macro=2 if mining_area== 3 & endepi>=mdy(01,01,2008)
 92.                 replace macro=2 if mining_area== 4 & endepi>=mdy(01,01,2007)
 93. 
.                 * West-Germany: Unemployment below 10% in all years since 1990 
.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula<12
 94. 
.                 * East Germany: Unemployment below 10% for women since 2012, for men since 2015 
.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2012) & frau==1
 95.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2014) & frau==0
 96.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2012) & frau==1
 97.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2014) & frau==0
 98.                 cap label drop macroLAB
 99.                 label define macroLAB 1 "hi-unemp" 2 "lo-unemp" 
100.                 label values macro macroLAB
101. 
. * produce tables of the descriptive stats for the three datasets
. 
. tab agecat2,m
102. tab frau,m
103. tab educ2,m
104. tab livarea, m
105. tab macro,m
106. tab status, m
107. tab beruf12, m
108. 
. **********************************************************************
. ******
. * JAERE December 2022 - industry sectors after coal
. * => see 5estimations section (2); section (9.5.1)
. 
.         * JAERE - R2.MC7 - Distribution of length of spells in lignite
.         * new january 2023
.         disp("distribution of durations of this sample")
109.         su dur, det
110.         disp("distribution of durations in lignite of this sample")
111.         su dur if thisspelllignite==1, det
112.         disp("distribution of durations in lignite & statsimple==1 of this sample")
113.         su dur if thisspelllignite==1 & statsimple==1, det
114.         disp("")
115.         su dur if thisspelllignite==0 & statsimple==1, det
116. 
.         * test the specific criterion for inclusion 6 months in lignite mining
.         count if dur<=180 
117.         * distributions for durations below 3651 days
.         *                       below 1000 days, below 500 days, below 365 days
. 
. local durations 181 366 500 1000 3700 7300
118. foreach d of local durations {
119.                 cap histogram dur if statsimple==1 & dur<=`d'
120.                 cap graph save dur`d'sample${sample}run`i'.gph, replace
121.                 cap graph export dur`d'sample${sample}run`i'.png, replace
122.         }
123.         
. **********************************************************************
. local i = `i' + 1
124. }               
{ required
r(100); t=0.00 9:07:05

end of do-file

r(100); t=0.00 9:07:05

. do "C:\Users\JanserM\AppData\Local\Temp\18\STD6cf8_000000.tmp"

. 
. local i = 1
r; t=0.00 9:07:28

. while `i' < 5 { 
  2. if `i'==1
  3. *first run descriptive: run analysis on data already loaded
. disp("first column: whole sample")
  4. 
. if `i'==2{
  5. * if i=2, second run: only coal spells
. * reload dataset to generate newly the macro conditions of coal spells
. disp("second column: only coal spells")
  6. use ${data}/precoll.dta, clear
  7. drop if thisspelllignite==0
  8. }
  9. 
. if `i'==3{
 10. * if i=3, third run: only sample used to calculate coal wage distribution
.         if ${sample}<7{
 11.                 use ${data}\wage_sample_wcoal_estimation.dta, clear
 12.         }
 13.         if ${sample}==7{
 14.                 use ${data}\wage_sample7_wcoal_estimation.dta, clear    
 15.                 }
 16.         if ${sample}==8{
 17.                 use ${data}\wage_sample8_wcoal_estimation.dta, clear
 18.         }
 19.         if ${sample}==9{
 20.                 use ${data}\wage_sample9_wcoal_estimation.dta, clear
 21.         }
 22. 
. disp("second column: only wage spells used for coal wage distribution")
 23. keep if (wcoal_end_monthly==.)
 24. }
 25. 
. if `i'==4{
 26. * if i=4, fourth run: only sample used to calculate non-coal wage distribution
. use ${data}\wage_sample_wnc_estimation.dta, clear
 27. disp("second column: only wage spells used for non-coal wage distribution")
 28. keep if (wcoal_end_monthly==. | wnc_offer_tentg_beg==.)
 29. }
 30. *** (!) total number of spells / number of lignite spells / size wage sample
. disp("total number of spells")
 31. count
 32. 
. *** (!) count how many individuals contribute to estimation
. g delfirstpid=.
 33. bys pid: replace delfirstpid=(_n==1)
 34. disp("distinct individuals contributing to estimation")
 35. count if (delfirstpid==1)
 36. drop delfirstpid
 37. 
. *** Define variables for descriptive statistics
. 
.         * (6.1) Categorical age variable agecat2 already defined
.         
.         * (6.2) Define categorical edu variable
.                         * g educat2=. 
.                         * replace educat2 = 1 if bild==1
.                         * replace educat2 = 2 if (bild==2 | bild ==3)
.                         
.         * (6.3) Create resid_area as generalisation of mining area for non-coal jobs
.                         cap drop livarea
 38.                         g livarea=.
 39.                         * Mining Area 1: Lausitz
.                         replace livarea = 1 if ao_kreis == 12052 // Stadt Cottbus (Brandenburg)
 40.                         replace livarea = 1 if ao_kreis == 12061 // LK Dahme-Spreewald (Brandenburg)
 41.                         replace livarea = 1 if ao_kreis == 12062 // LK Elbe-Elster (Brandenburg)
 42.                         replace livarea = 1 if ao_kreis == 12066 // LK Oberspreewald-Lausitz (Brandenburg)
 43.                         replace livarea = 1 if ao_kreis == 12071 // LK Spree-Neisse (Brandenburg)
 44.                         replace livarea = 1 if ao_kreis == 14625 // LK Bautzen (Sachsen)
 45.                         replace livarea = 1 if ao_kreis == 14626 // LK Goerlitz (Sachsen)
 46.                         * Mining Area 2: Mitteldeutsches Revier
.                         replace livarea = 2 if ao_kreis == 14713 // Stadt Leipzig (Sachsen)
 47.                         replace livarea = 2 if ao_kreis == 14729 // LK Leipzig (Sachsen)
 48.                         replace livarea = 2 if ao_kreis == 14730 // LK Nordsachsen (Sachsen)
 49.                         replace livarea = 2 if ao_kreis == 15002 // Stadt Halle(Saale)
 50.                         replace livarea = 2 if ao_kreis == 15082 // LK Anhalt-Bitterfeld (Sachsen-Anhalt)
 51.                         replace livarea = 2 if ao_kreis == 15084 // LK Burgenlandkreis (Sachsen-Anhalt)
 52.                         replace livarea = 2 if ao_kreis == 15087 // LK Mansfeld-Südharz (Sachsen-Anhalt)
 53.                         replace livarea = 2 if ao_kreis == 15088 // LK Saalekreis (Sachsen-Anhalt)
 54.                         replace livarea = 2 if ao_kreis == 15091 // LK Wittenberg (Sachsen-Anhalt)
 55.                         replace livarea = 2 if ao_kreis == 16077 // LK Altenburger Land (Thüringen)
 56.                         replace livarea = 2 if ao_kreis == 16075 // LK Saale-Orla-Kreis (Thüringen)
 57.                         * Mining Area 3: Rheinisches Revier
.                         replace livarea = 3 if ao_kreis == 05112 // Stadt Duisburg (NRW)
 58.                         replace livarea = 3 if ao_kreis == 05162 // LK Rhein-Kreis Neuss (NRW)
 59.                         replace livarea = 3 if ao_kreis == 05315 // Stadt Köln (NRW)
 60.                         replace livarea = 3 if ao_kreis == 05334 // LK Städteregion Aachen (NRW)
 61.                         replace livarea = 3 if ao_kreis == 05362 // LK Rhein-Erft-Kreis (NRW)
 62.                         replace livarea = 3 if ao_kreis == 05358 // LK Düren (NRW)
 63.                         replace livarea = 3 if ao_kreis == 05366 // LK Euskirchen (NRW)
 64.                         * Mining Area 4: Other Coal areas - (first two are Helmstedter Revier)
.                         replace livarea = 4 if ao_kreis == 03154 // LK Helmstedt (Niedersachsen)
 65.                         replace livarea = 4 if ao_kreis == 15083 // LK Börde (Sachsen-Anhalt)
 66.                         replace livarea = 4 if ao_kreis == 03153 // LK Goslar
 67.                         replace livarea = 4 if ao_kreis == 03241 // Region Hannover
 68.                         replace livarea = 4 if ao_kreis == 05570 // LK Warendorf
 69.                         replace livarea = 4 if ao_kreis == 06440 // LK Wetteraukreis
 70.                         replace livarea = 4 if ao_kreis == 06611 // Stadt Kassel
 71.                         replace livarea = 4 if ao_kreis == 06634 // LK Schwalm-Eder-Kreis
 72.                         replace livarea = 4 if ao_kreis == 06636 // LK Werra-Meißner-Kreis
 73.                         replace livarea = 4 if ao_kreis == 09162 // Stadt München
 74.                         replace livarea = 4 if ao_kreis == 09376 // LK Schwandorf
 75.                         replace livarea = 4 if ao_kreis == 09672 // LK Bad Kissingen
 76.                         replace livarea = 4 if ao_kreis == 10041 // Regionalverband Saarbrücken
 77.                         replace livarea = 4 if ao_kreis == 10044 // LK Saarlouis
 78.                         replace livarea = 4 if ao_kreis == 11000 // Stadt Berlin
 79.                         replace livarea = 4 if ao_kreis == 13073 // LK Vorpommern-Rügen
 80.                         replace livarea = 4 if ao_kreis == 14521 // LK Erzgebirgskreis  
 81.                         * Non-Mining Areas 5: Other undefined Reviere
.                         replace livarea = 5 if livarea == . & ao_kreis !=.
 82.                         label define livareas 1 "Lusatia" 2 "Central Germany" 3 "Rhineland" 4 "Other coal area" 5 "Other non-coa
> l areas"
 83.                         label val livarea areas
 84. 
.         * (6.4) Create macroeconomic conditions
. 
.         * Note that the cell-based approach first cuts spells which span
.         * across different macroeconomic conditions. 
.         * Here we do not do this.
.                         
.                 g macro=.
 85. 
.                 * bad macro conditions = 1 / good macro conditions = 2
.                 * approximations here
.                 * (1) good macro is less than 10% unemployment
.                 * (2)   Lausitz:    from (incl) 2015-
.                 *               Rheinisches from (incl) 2007 -
.                 *       Helmstedter from (incl) 2008 - 
.                 *               Mitteldeutsches from (incl) 2016 -
.                 replace macro=1 if mining_area== 1 & endepi<mdy(01,01,2015)
 86.                 replace macro=1 if mining_area== 2 & endepi<mdy(01,01,2016)
 87.                 replace macro=1 if mining_area== 3 & endepi<mdy(01,01,2008)
 88.                 replace macro=1 if mining_area== 4 & endepi<mdy(01,01,2007)
 89.                 
.                 replace macro=2 if mining_area== 1 & endepi>=mdy(01,01,2015)
 90.                 replace macro=2 if mining_area== 2 & endepi>=mdy(01,01,2016)
 91.                 replace macro=2 if mining_area== 3 & endepi>=mdy(01,01,2008)
 92.                 replace macro=2 if mining_area== 4 & endepi>=mdy(01,01,2007)
 93. 
.                 * West-Germany: Unemployment below 10% in all years since 1990 
.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula<12
 94. 
.                 * East Germany: Unemployment below 10% for women since 2012, for men since 2015 
.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2012) & frau==1
 95.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2014) & frau==0
 96.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2012) & frau==1
 97.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2014) & frau==0
 98.                 cap label drop macroLAB
 99.                 label define macroLAB 1 "hi-unemp" 2 "lo-unemp" 
100.                 label values macro macroLAB
101. 
. * produce tables of the descriptive stats for the three datasets
. 
. tab agecat2,m
102. tab frau,m
103. tab educ2,m
104. tab livarea, m
105. tab macro,m
106. tab status, m
107. tab beruf12, m
108. 
. **********************************************************************
. ******
. * JAERE December 2022 - industry sectors after coal
. * => see 5estimations section (2); section (9.5.1)
. 
.         * JAERE - R2.MC7 - Distribution of length of spells in lignite
.         * new january 2023
.         disp("distribution of durations of this sample")
109.         su dur, det
110.         disp("distribution of durations in lignite of this sample")
111.         su dur if thisspelllignite==1, det
112.         disp("distribution of durations in lignite & statsimple==1 of this sample")
113.         su dur if thisspelllignite==1 & statsimple==1, det
114.         disp("")
115.         su dur if thisspelllignite==0 & statsimple==1, det
116. 
.         * test the specific criterion for inclusion 6 months in lignite mining
.         count if dur<=180 
117.         * distributions for durations below 3651 days
.         *                       below 1000 days, below 500 days, below 365 days
. 
. local durations 181 366 500 1000 3700 7300
118. foreach d of local durations {
119.                 cap histogram dur if statsimple==1 & dur<=`d'
120.                 cap graph save dur`d'sample${sample}run`i'.gph, replace
121.                 cap graph export dur`d'sample${sample}run`i'.png, replace
122.         }
123.         
. **********************************************************************
. local i = `i' + 1
124. }               
{ required
r(100); t=0.00 9:07:29

end of do-file

r(100); t=0.00 9:07:29

. do "C:\Users\JanserM\AppData\Local\Temp\18\STD6cf8_000000.tmp"

. local i = 1
r; t=0.00 9:09:42

. while `i' < 5 { 
  2. if `i'==1
  3. *first run descriptive: run analysis on data already loaded
. disp("first column: whole sample")
  4. 
. if `i'==2{
  5. * if i=2, second run: only coal spells
. * reload dataset to generate newly the macro conditions of coal spells
. disp("second column: only coal spells")
  6. use ${data}/precoll.dta, clear
  7. drop if thisspelllignite==0
  8. }
  9. 
. if `i'==3{
 10. * if i=3, third run: only sample used to calculate coal wage distribution
.         if ${sample}<7{
 11.                 use ${data}\wage_sample_wcoal_estimation.dta, clear
 12.         }
 13.         if ${sample}==7{
 14.                 use ${data}\wage_sample7_wcoal_estimation.dta, clear    
 15.                 }
 16.         if ${sample}==8{
 17.                 use ${data}\wage_sample8_wcoal_estimation.dta, clear
 18.         }
 19.         if ${sample}==9{
 20.                 use ${data}\wage_sample9_wcoal_estimation.dta, clear
 21.         }
 22. 
. disp("second column: only wage spells used for coal wage distribution")
 23. keep if (wcoal_end_monthly==.)
 24. }
 25. 
. if `i'==4{
 26. * if i=4, fourth run: only sample used to calculate non-coal wage distribution
. use ${data}\wage_sample_wnc_estimation.dta, clear
 27. disp("second column: only wage spells used for non-coal wage distribution")
 28. keep if (wcoal_end_monthly==. | wnc_offer_tentg_beg==.)
 29. }
 30. 
. 
. *** (!) total number of spells / number of lignite spells / size wage sample
. disp("total number of spells")
 31. count
 32. 
. *** (!) count how many individuals contribute to estimation
. g delfirstpid=.
 33. bys pid: replace delfirstpid=(_n==1)
 34. disp("distinct individuals contributing to estimation")
 35. count if (delfirstpid==1)
 36. drop delfirstpid
 37. 
. *** Define variables for descriptive statistics
. 
.         * (6.1) Categorical age variable agecat2 already defined
.         
.         * (6.2) Define categorical edu variable
.                         * g educat2=. 
.                         * replace educat2 = 1 if bild==1
.                         * replace educat2 = 2 if (bild==2 | bild ==3)
.                         
.         * (6.3) Create resid_area as generalisation of mining area for non-coal jobs
.                         cap drop livarea
 38.                         g livarea=.
 39.                         * Mining Area 1: Lausitz
.                         replace livarea = 1 if ao_kreis == 12052 // Stadt Cottbus (Brandenburg)
 40.                         replace livarea = 1 if ao_kreis == 12061 // LK Dahme-Spreewald (Brandenburg)
 41.                         replace livarea = 1 if ao_kreis == 12062 // LK Elbe-Elster (Brandenburg)
 42.                         replace livarea = 1 if ao_kreis == 12066 // LK Oberspreewald-Lausitz (Brandenburg)
 43.                         replace livarea = 1 if ao_kreis == 12071 // LK Spree-Neisse (Brandenburg)
 44.                         replace livarea = 1 if ao_kreis == 14625 // LK Bautzen (Sachsen)
 45.                         replace livarea = 1 if ao_kreis == 14626 // LK Goerlitz (Sachsen)
 46.                         * Mining Area 2: Mitteldeutsches Revier
.                         replace livarea = 2 if ao_kreis == 14713 // Stadt Leipzig (Sachsen)
 47.                         replace livarea = 2 if ao_kreis == 14729 // LK Leipzig (Sachsen)
 48.                         replace livarea = 2 if ao_kreis == 14730 // LK Nordsachsen (Sachsen)
 49.                         replace livarea = 2 if ao_kreis == 15002 // Stadt Halle(Saale)
 50.                         replace livarea = 2 if ao_kreis == 15082 // LK Anhalt-Bitterfeld (Sachsen-Anhalt)
 51.                         replace livarea = 2 if ao_kreis == 15084 // LK Burgenlandkreis (Sachsen-Anhalt)
 52.                         replace livarea = 2 if ao_kreis == 15087 // LK Mansfeld-Südharz (Sachsen-Anhalt)
 53.                         replace livarea = 2 if ao_kreis == 15088 // LK Saalekreis (Sachsen-Anhalt)
 54.                         replace livarea = 2 if ao_kreis == 15091 // LK Wittenberg (Sachsen-Anhalt)
 55.                         replace livarea = 2 if ao_kreis == 16077 // LK Altenburger Land (Thüringen)
 56.                         replace livarea = 2 if ao_kreis == 16075 // LK Saale-Orla-Kreis (Thüringen)
 57.                         * Mining Area 3: Rheinisches Revier
.                         replace livarea = 3 if ao_kreis == 05112 // Stadt Duisburg (NRW)
 58.                         replace livarea = 3 if ao_kreis == 05162 // LK Rhein-Kreis Neuss (NRW)
 59.                         replace livarea = 3 if ao_kreis == 05315 // Stadt Köln (NRW)
 60.                         replace livarea = 3 if ao_kreis == 05334 // LK Städteregion Aachen (NRW)
 61.                         replace livarea = 3 if ao_kreis == 05362 // LK Rhein-Erft-Kreis (NRW)
 62.                         replace livarea = 3 if ao_kreis == 05358 // LK Düren (NRW)
 63.                         replace livarea = 3 if ao_kreis == 05366 // LK Euskirchen (NRW)
 64.                         * Mining Area 4: Other Coal areas - (first two are Helmstedter Revier)
.                         replace livarea = 4 if ao_kreis == 03154 // LK Helmstedt (Niedersachsen)
 65.                         replace livarea = 4 if ao_kreis == 15083 // LK Börde (Sachsen-Anhalt)
 66.                         replace livarea = 4 if ao_kreis == 03153 // LK Goslar
 67.                         replace livarea = 4 if ao_kreis == 03241 // Region Hannover
 68.                         replace livarea = 4 if ao_kreis == 05570 // LK Warendorf
 69.                         replace livarea = 4 if ao_kreis == 06440 // LK Wetteraukreis
 70.                         replace livarea = 4 if ao_kreis == 06611 // Stadt Kassel
 71.                         replace livarea = 4 if ao_kreis == 06634 // LK Schwalm-Eder-Kreis
 72.                         replace livarea = 4 if ao_kreis == 06636 // LK Werra-Meißner-Kreis
 73.                         replace livarea = 4 if ao_kreis == 09162 // Stadt München
 74.                         replace livarea = 4 if ao_kreis == 09376 // LK Schwandorf
 75.                         replace livarea = 4 if ao_kreis == 09672 // LK Bad Kissingen
 76.                         replace livarea = 4 if ao_kreis == 10041 // Regionalverband Saarbrücken
 77.                         replace livarea = 4 if ao_kreis == 10044 // LK Saarlouis
 78.                         replace livarea = 4 if ao_kreis == 11000 // Stadt Berlin
 79.                         replace livarea = 4 if ao_kreis == 13073 // LK Vorpommern-Rügen
 80.                         replace livarea = 4 if ao_kreis == 14521 // LK Erzgebirgskreis  
 81.                         * Non-Mining Areas 5: Other undefined Reviere
.                         replace livarea = 5 if livarea == . & ao_kreis !=.
 82.                         label define livareas 1 "Lusatia" 2 "Central Germany" 3 "Rhineland" 4 "Other coal area" 5 "Other non-coa
> l areas"
 83.                         label val livarea areas
 84. 
.         * (6.4) Create macroeconomic conditions
. 
.         * Note that the cell-based approach first cuts spells which span
.         * across different macroeconomic conditions. 
.         * Here we do not do this.
.                         
.                 g macro=.
 85. 
.                 * bad macro conditions = 1 / good macro conditions = 2
.                 * approximations here
.                 * (1) good macro is less than 10% unemployment
.                 * (2)   Lausitz:    from (incl) 2015-
.                 *               Rheinisches from (incl) 2007 -
.                 *       Helmstedter from (incl) 2008 - 
.                 *               Mitteldeutsches from (incl) 2016 -
.                 replace macro=1 if mining_area== 1 & endepi<mdy(01,01,2015)
 86.                 replace macro=1 if mining_area== 2 & endepi<mdy(01,01,2016)
 87.                 replace macro=1 if mining_area== 3 & endepi<mdy(01,01,2008)
 88.                 replace macro=1 if mining_area== 4 & endepi<mdy(01,01,2007)
 89.                 
.                 replace macro=2 if mining_area== 1 & endepi>=mdy(01,01,2015)
 90.                 replace macro=2 if mining_area== 2 & endepi>=mdy(01,01,2016)
 91.                 replace macro=2 if mining_area== 3 & endepi>=mdy(01,01,2008)
 92.                 replace macro=2 if mining_area== 4 & endepi>=mdy(01,01,2007)
 93. 
.                 * West-Germany: Unemployment below 10% in all years since 1990 
.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula<12
 94. 
.                 * East Germany: Unemployment below 10% for women since 2012, for men since 2015 
.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2012) & frau==1
 95.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2014) & frau==0
 96.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2012) & frau==1
 97.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2014) & frau==0
 98.                 cap label drop macroLAB
 99.                 label define macroLAB 1 "hi-unemp" 2 "lo-unemp" 
100.                 label values macro macroLAB
101. 
. * produce tables of the descriptive stats for the three datasets
. 
. tab agecat2,m
102. tab frau,m
103. tab educ2,m
104. tab livarea, m
105. tab macro,m
106. tab status, m
107. tab beruf12, m
108. 
. **********************************************************************
. ******
. * JAERE December 2022 - industry sectors after coal
. * => see 5estimations section (2); section (9.5.1)
. 
.         * JAERE - R2.MC7 - Distribution of length of spells in lignite
.         * new january 2023
.         disp("distribution of durations of this sample")
109.         su dur, det
110.         disp("distribution of durations in lignite of this sample")
111.         su dur if thisspelllignite==1, det
112.         disp("distribution of durations in lignite & statsimple==1 of this sample")
113.         su dur if thisspelllignite==1 & statsimple==1, det
114. 
unexpected end of file
r(612); t=0.00 9:09:42

end of do-file

r(612); t=0.00 9:09:42
. do "C:\Users\JanserM\AppData\Local\Temp\18\STD6cf8_000000.tmp"

. local i = 1
r; t=0.00 9:10:15

. while `i' < 5 { 
  2. if `i'==1
  3. *first run descriptive: run analysis on data already loaded
. disp("first column: whole sample")
  4. 
. if `i'==2{
  5. * if i=2, second run: only coal spells
. * reload dataset to generate newly the macro conditions of coal spells
. disp("second column: only coal spells")
  6. use ${data}/precoll.dta, clear
  7. drop if thisspelllignite==0
  8. }
  9. 
. if `i'==3{
 10. * if i=3, third run: only sample used to calculate coal wage distribution
.         if ${sample}<7{
 11.                 use ${data}\wage_sample_wcoal_estimation.dta, clear
 12.         }
 13.         if ${sample}==7{
 14.                 use ${data}\wage_sample7_wcoal_estimation.dta, clear    
 15.                 }
 16.         if ${sample}==8{
 17.                 use ${data}\wage_sample8_wcoal_estimation.dta, clear
 18.         }
 19.         if ${sample}==9{
 20.                 use ${data}\wage_sample9_wcoal_estimation.dta, clear
 21.         }
 22. 
. disp("second column: only wage spells used for coal wage distribution")
 23. keep if (wcoal_end_monthly==.)
 24. }
 25. 
. if `i'==4{
 26. * if i=4, fourth run: only sample used to calculate non-coal wage distribution
. use ${data}\wage_sample_wnc_estimation.dta, clear
 27. disp("second column: only wage spells used for non-coal wage distribution")
 28. keep if (wcoal_end_monthly==. | wnc_offer_tentg_beg==.)
 29. }
 30. 
. 
. *** (!) total number of spells / number of lignite spells / size wage sample
. disp("total number of spells")
 31. count
 32. 
. *** (!) count how many individuals contribute to estimation
. g delfirstpid=.
 33. bys pid: replace delfirstpid=(_n==1)
 34. disp("distinct individuals contributing to estimation")
 35. count if (delfirstpid==1)
 36. drop delfirstpid
 37. 
. *** Define variables for descriptive statistics
. 
.         * (6.1) Categorical age variable agecat2 already defined
.         
.         * (6.2) Define categorical edu variable
.                         * g educat2=. 
.                         * replace educat2 = 1 if bild==1
.                         * replace educat2 = 2 if (bild==2 | bild ==3)
.                         
.         * (6.3) Create resid_area as generalisation of mining area for non-coal jobs
.                         cap drop livarea
 38.                         g livarea=.
 39.                         * Mining Area 1: Lausitz
.                         replace livarea = 1 if ao_kreis == 12052 // Stadt Cottbus (Brandenburg)
 40.                         replace livarea = 1 if ao_kreis == 12061 // LK Dahme-Spreewald (Brandenburg)
 41.                         replace livarea = 1 if ao_kreis == 12062 // LK Elbe-Elster (Brandenburg)
 42.                         replace livarea = 1 if ao_kreis == 12066 // LK Oberspreewald-Lausitz (Brandenburg)
 43.                         replace livarea = 1 if ao_kreis == 12071 // LK Spree-Neisse (Brandenburg)
 44.                         replace livarea = 1 if ao_kreis == 14625 // LK Bautzen (Sachsen)
 45.                         replace livarea = 1 if ao_kreis == 14626 // LK Goerlitz (Sachsen)
 46.                         * Mining Area 2: Mitteldeutsches Revier
.                         replace livarea = 2 if ao_kreis == 14713 // Stadt Leipzig (Sachsen)
 47.                         replace livarea = 2 if ao_kreis == 14729 // LK Leipzig (Sachsen)
 48.                         replace livarea = 2 if ao_kreis == 14730 // LK Nordsachsen (Sachsen)
 49.                         replace livarea = 2 if ao_kreis == 15002 // Stadt Halle(Saale)
 50.                         replace livarea = 2 if ao_kreis == 15082 // LK Anhalt-Bitterfeld (Sachsen-Anhalt)
 51.                         replace livarea = 2 if ao_kreis == 15084 // LK Burgenlandkreis (Sachsen-Anhalt)
 52.                         replace livarea = 2 if ao_kreis == 15087 // LK Mansfeld-Südharz (Sachsen-Anhalt)
 53.                         replace livarea = 2 if ao_kreis == 15088 // LK Saalekreis (Sachsen-Anhalt)
 54.                         replace livarea = 2 if ao_kreis == 15091 // LK Wittenberg (Sachsen-Anhalt)
 55.                         replace livarea = 2 if ao_kreis == 16077 // LK Altenburger Land (Thüringen)
 56.                         replace livarea = 2 if ao_kreis == 16075 // LK Saale-Orla-Kreis (Thüringen)
 57.                         * Mining Area 3: Rheinisches Revier
.                         replace livarea = 3 if ao_kreis == 05112 // Stadt Duisburg (NRW)
 58.                         replace livarea = 3 if ao_kreis == 05162 // LK Rhein-Kreis Neuss (NRW)
 59.                         replace livarea = 3 if ao_kreis == 05315 // Stadt Köln (NRW)
 60.                         replace livarea = 3 if ao_kreis == 05334 // LK Städteregion Aachen (NRW)
 61.                         replace livarea = 3 if ao_kreis == 05362 // LK Rhein-Erft-Kreis (NRW)
 62.                         replace livarea = 3 if ao_kreis == 05358 // LK Düren (NRW)
 63.                         replace livarea = 3 if ao_kreis == 05366 // LK Euskirchen (NRW)
 64.                         * Mining Area 4: Other Coal areas - (first two are Helmstedter Revier)
.                         replace livarea = 4 if ao_kreis == 03154 // LK Helmstedt (Niedersachsen)
 65.                         replace livarea = 4 if ao_kreis == 15083 // LK Börde (Sachsen-Anhalt)
 66.                         replace livarea = 4 if ao_kreis == 03153 // LK Goslar
 67.                         replace livarea = 4 if ao_kreis == 03241 // Region Hannover
 68.                         replace livarea = 4 if ao_kreis == 05570 // LK Warendorf
 69.                         replace livarea = 4 if ao_kreis == 06440 // LK Wetteraukreis
 70.                         replace livarea = 4 if ao_kreis == 06611 // Stadt Kassel
 71.                         replace livarea = 4 if ao_kreis == 06634 // LK Schwalm-Eder-Kreis
 72.                         replace livarea = 4 if ao_kreis == 06636 // LK Werra-Meißner-Kreis
 73.                         replace livarea = 4 if ao_kreis == 09162 // Stadt München
 74.                         replace livarea = 4 if ao_kreis == 09376 // LK Schwandorf
 75.                         replace livarea = 4 if ao_kreis == 09672 // LK Bad Kissingen
 76.                         replace livarea = 4 if ao_kreis == 10041 // Regionalverband Saarbrücken
 77.                         replace livarea = 4 if ao_kreis == 10044 // LK Saarlouis
 78.                         replace livarea = 4 if ao_kreis == 11000 // Stadt Berlin
 79.                         replace livarea = 4 if ao_kreis == 13073 // LK Vorpommern-Rügen
 80.                         replace livarea = 4 if ao_kreis == 14521 // LK Erzgebirgskreis  
 81.                         * Non-Mining Areas 5: Other undefined Reviere
.                         replace livarea = 5 if livarea == . & ao_kreis !=.
 82.                         label define livareas 1 "Lusatia" 2 "Central Germany" 3 "Rhineland" 4 "Other coal area" 5 "Other non-coa
> l areas"
 83.                         label val livarea areas
 84. 
.         * (6.4) Create macroeconomic conditions
. 
.         * Note that the cell-based approach first cuts spells which span
.         * across different macroeconomic conditions. 
.         * Here we do not do this.
.                         
.                 g macro=.
 85. 
.                 * bad macro conditions = 1 / good macro conditions = 2
.                 * approximations here
.                 * (1) good macro is less than 10% unemployment
.                 * (2)   Lausitz:    from (incl) 2015-
.                 *               Rheinisches from (incl) 2007 -
.                 *       Helmstedter from (incl) 2008 - 
.                 *               Mitteldeutsches from (incl) 2016 -
.                 replace macro=1 if mining_area== 1 & endepi<mdy(01,01,2015)
 86.                 replace macro=1 if mining_area== 2 & endepi<mdy(01,01,2016)
 87.                 replace macro=1 if mining_area== 3 & endepi<mdy(01,01,2008)
 88.                 replace macro=1 if mining_area== 4 & endepi<mdy(01,01,2007)
 89.                 
.                 replace macro=2 if mining_area== 1 & endepi>=mdy(01,01,2015)
 90.                 replace macro=2 if mining_area== 2 & endepi>=mdy(01,01,2016)
 91.                 replace macro=2 if mining_area== 3 & endepi>=mdy(01,01,2008)
 92.                 replace macro=2 if mining_area== 4 & endepi>=mdy(01,01,2007)
 93. 
.                 * West-Germany: Unemployment below 10% in all years since 1990 
.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula<12
 94. 
.                 * East Germany: Unemployment below 10% for women since 2012, for men since 2015 
.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2012) & frau==1
 95.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2014) & frau==0
 96.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2012) & frau==1
 97.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2014) & frau==0
 98.                 cap label drop macroLAB
 99.                 label define macroLAB 1 "hi-unemp" 2 "lo-unemp" 
100.                 label values macro macroLAB
101. 
. * produce tables of the descriptive stats for the three datasets
. 
. tab agecat2,m
102. tab frau,m
103. tab educ2,m
104. tab livarea, m
105. tab macro,m
106. tab status, m
107. tab beruf12, m
108. 
. **********************************************************************
. ******
. * JAERE December 2022 - industry sectors after coal
. * => see 5estimations section (2); section (9.5.1)
. 
.         * JAERE - R2.MC7 - Distribution of length of spells in lignite
.         * new january 2023
.         disp("distribution of durations of this sample")
109.         su dur, det
110.         disp("distribution of durations in lignite of this sample")
111.         su dur if thisspelllignite==1, det
112.         disp("distribution of durations in lignite & statsimple==1 of this sample")
113.         su dur if thisspelllignite==1 & statsimple==1, det
114.         disp("")
115.         su dur if thisspelllignite==0 & statsimple==1, det
116. 
.         * test the specific criterion for inclusion 6 months in lignite mining
.         count if dur<=180 
117.         * distributions for durations below 3651 days
.         *                       below 1000 days, below 500 days, below 365 days
. 
. local durations 181 366 500 1000 3700 7300
118. foreach d of local durations {
119.                 cap histogram dur if statsimple==1 & dur<=`d'
120.                 cap graph save dur`d'sample${sample}run`i'.gph, replace
121.                 cap graph export dur`d'sample${sample}run`i'.png, replace
122.         }
123.         
. **********************************************************************
. local i = `i' + 1
124. }               
{ required
r(100); t=0.00 9:10:16

end of do-file

r(100); t=0.00 9:10:16

. do "C:\Users\JanserM\AppData\Local\Temp\18\STD6cf8_000000.tmp"

. 
. local i = 1
r; t=0.00 9:13:58

. while `i' < 5 { 
  2. if `i'==1{
  3. *first run descriptive: run analysis on data already loaded
. disp("first column: whole sample")
  4. 
. if `i'==2{
  5. * if i=2, second run: only coal spells
. * reload dataset to generate newly the macro conditions of coal spells
. disp("second column: only coal spells")
  6. use ${data}/precoll.dta, clear
  7. drop if thisspelllignite==0
  8. }
  9. 
. if `i'==3{
 10. * if i=3, third run: only sample used to calculate coal wage distribution
.         if ${sample}<7{
 11.                 use ${data}\wage_sample_wcoal_estimation.dta, clear
 12.         }
 13.         if ${sample}==7{
 14.                 use ${data}\wage_sample7_wcoal_estimation.dta, clear    
 15.                 }
 16.         if ${sample}==8{
 17.                 use ${data}\wage_sample8_wcoal_estimation.dta, clear
 18.         }
 19.         if ${sample}==9{
 20.                 use ${data}\wage_sample9_wcoal_estimation.dta, clear
 21.         }
 22. 
. disp("second column: only wage spells used for coal wage distribution")
 23. keep if (wcoal_end_monthly==.)
 24. }
 25. 
. if `i'==4{
 26. * if i=4, fourth run: only sample used to calculate non-coal wage distribution
. use ${data}\wage_sample_wnc_estimation.dta, clear
 27. disp("second column: only wage spells used for non-coal wage distribution")
 28. keep if (wcoal_end_monthly==. | wnc_offer_tentg_beg==.)
 29. }
 30. 
. 
. *** (!) total number of spells / number of lignite spells / size wage sample
. disp("total number of spells")
 31. count
 32. 
. *** (!) count how many individuals contribute to estimation
. g delfirstpid=.
 33. bys pid: replace delfirstpid=(_n==1)
 34. disp("distinct individuals contributing to estimation")
 35. count if (delfirstpid==1)
 36. drop delfirstpid
 37. 
. *** Define variables for descriptive statistics
. 
.         * (6.1) Categorical age variable agecat2 already defined
.         
.         * (6.2) Define categorical edu variable
.                         * g educat2=. 
.                         * replace educat2 = 1 if bild==1
.                         * replace educat2 = 2 if (bild==2 | bild ==3)
.                         
.         * (6.3) Create resid_area as generalisation of mining area for non-coal jobs
.                         cap drop livarea
 38.                         g livarea=.
 39.                         * Mining Area 1: Lausitz
.                         replace livarea = 1 if ao_kreis == 12052 // Stadt Cottbus (Brandenburg)
 40.                         replace livarea = 1 if ao_kreis == 12061 // LK Dahme-Spreewald (Brandenburg)
 41.                         replace livarea = 1 if ao_kreis == 12062 // LK Elbe-Elster (Brandenburg)
 42.                         replace livarea = 1 if ao_kreis == 12066 // LK Oberspreewald-Lausitz (Brandenburg)
 43.                         replace livarea = 1 if ao_kreis == 12071 // LK Spree-Neisse (Brandenburg)
 44.                         replace livarea = 1 if ao_kreis == 14625 // LK Bautzen (Sachsen)
 45.                         replace livarea = 1 if ao_kreis == 14626 // LK Goerlitz (Sachsen)
 46.                         * Mining Area 2: Mitteldeutsches Revier
.                         replace livarea = 2 if ao_kreis == 14713 // Stadt Leipzig (Sachsen)
 47.                         replace livarea = 2 if ao_kreis == 14729 // LK Leipzig (Sachsen)
 48.                         replace livarea = 2 if ao_kreis == 14730 // LK Nordsachsen (Sachsen)
 49.                         replace livarea = 2 if ao_kreis == 15002 // Stadt Halle(Saale)
 50.                         replace livarea = 2 if ao_kreis == 15082 // LK Anhalt-Bitterfeld (Sachsen-Anhalt)
 51.                         replace livarea = 2 if ao_kreis == 15084 // LK Burgenlandkreis (Sachsen-Anhalt)
 52.                         replace livarea = 2 if ao_kreis == 15087 // LK Mansfeld-Südharz (Sachsen-Anhalt)
 53.                         replace livarea = 2 if ao_kreis == 15088 // LK Saalekreis (Sachsen-Anhalt)
 54.                         replace livarea = 2 if ao_kreis == 15091 // LK Wittenberg (Sachsen-Anhalt)
 55.                         replace livarea = 2 if ao_kreis == 16077 // LK Altenburger Land (Thüringen)
 56.                         replace livarea = 2 if ao_kreis == 16075 // LK Saale-Orla-Kreis (Thüringen)
 57.                         * Mining Area 3: Rheinisches Revier
.                         replace livarea = 3 if ao_kreis == 05112 // Stadt Duisburg (NRW)
 58.                         replace livarea = 3 if ao_kreis == 05162 // LK Rhein-Kreis Neuss (NRW)
 59.                         replace livarea = 3 if ao_kreis == 05315 // Stadt Köln (NRW)
 60.                         replace livarea = 3 if ao_kreis == 05334 // LK Städteregion Aachen (NRW)
 61.                         replace livarea = 3 if ao_kreis == 05362 // LK Rhein-Erft-Kreis (NRW)
 62.                         replace livarea = 3 if ao_kreis == 05358 // LK Düren (NRW)
 63.                         replace livarea = 3 if ao_kreis == 05366 // LK Euskirchen (NRW)
 64.                         * Mining Area 4: Other Coal areas - (first two are Helmstedter Revier)
.                         replace livarea = 4 if ao_kreis == 03154 // LK Helmstedt (Niedersachsen)
 65.                         replace livarea = 4 if ao_kreis == 15083 // LK Börde (Sachsen-Anhalt)
 66.                         replace livarea = 4 if ao_kreis == 03153 // LK Goslar
 67.                         replace livarea = 4 if ao_kreis == 03241 // Region Hannover
 68.                         replace livarea = 4 if ao_kreis == 05570 // LK Warendorf
 69.                         replace livarea = 4 if ao_kreis == 06440 // LK Wetteraukreis
 70.                         replace livarea = 4 if ao_kreis == 06611 // Stadt Kassel
 71.                         replace livarea = 4 if ao_kreis == 06634 // LK Schwalm-Eder-Kreis
 72.                         replace livarea = 4 if ao_kreis == 06636 // LK Werra-Meißner-Kreis
 73.                         replace livarea = 4 if ao_kreis == 09162 // Stadt München
 74.                         replace livarea = 4 if ao_kreis == 09376 // LK Schwandorf
 75.                         replace livarea = 4 if ao_kreis == 09672 // LK Bad Kissingen
 76.                         replace livarea = 4 if ao_kreis == 10041 // Regionalverband Saarbrücken
 77.                         replace livarea = 4 if ao_kreis == 10044 // LK Saarlouis
 78.                         replace livarea = 4 if ao_kreis == 11000 // Stadt Berlin
 79.                         replace livarea = 4 if ao_kreis == 13073 // LK Vorpommern-Rügen
 80.                         replace livarea = 4 if ao_kreis == 14521 // LK Erzgebirgskreis  
 81.                         * Non-Mining Areas 5: Other undefined Reviere
.                         replace livarea = 5 if livarea == . & ao_kreis !=.
 82.                         label define livareas 1 "Lusatia" 2 "Central Germany" 3 "Rhineland" 4 "Other coal area" 5 "Other non-coa
> l areas"
 83.                         label val livarea areas
 84. 
.         * (6.4) Create macroeconomic conditions
. 
.         * Note that the cell-based approach first cuts spells which span
.         * across different macroeconomic conditions. 
.         * Here we do not do this.
.                         
.                 g macro=.
 85. 
.                 * bad macro conditions = 1 / good macro conditions = 2
.                 * approximations here
.                 * (1) good macro is less than 10% unemployment
.                 * (2)   Lausitz:    from (incl) 2015-
.                 *               Rheinisches from (incl) 2007 -
.                 *       Helmstedter from (incl) 2008 - 
.                 *               Mitteldeutsches from (incl) 2016 -
.                 replace macro=1 if mining_area== 1 & endepi<mdy(01,01,2015)
 86.                 replace macro=1 if mining_area== 2 & endepi<mdy(01,01,2016)
 87.                 replace macro=1 if mining_area== 3 & endepi<mdy(01,01,2008)
 88.                 replace macro=1 if mining_area== 4 & endepi<mdy(01,01,2007)
 89.                 
.                 replace macro=2 if mining_area== 1 & endepi>=mdy(01,01,2015)
 90.                 replace macro=2 if mining_area== 2 & endepi>=mdy(01,01,2016)
 91.                 replace macro=2 if mining_area== 3 & endepi>=mdy(01,01,2008)
 92.                 replace macro=2 if mining_area== 4 & endepi>=mdy(01,01,2007)
 93. 
.                 * West-Germany: Unemployment below 10% in all years since 1990 
.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula<12
 94. 
.                 * East Germany: Unemployment below 10% for women since 2012, for men since 2015 
.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2012) & frau==1
 95.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2014) & frau==0
 96.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2012) & frau==1
 97.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2014) & frau==0
 98.                 cap label drop macroLAB
 99.                 label define macroLAB 1 "hi-unemp" 2 "lo-unemp" 
100.                 label values macro macroLAB
101. 
. * produce tables of the descriptive stats for the three datasets
. 
. tab agecat2,m
102. tab frau,m
103. tab educ2,m
104. tab livarea, m
105. tab macro,m
106. tab status, m
107. tab beruf12, m
108. 
. **********************************************************************
. ******
. * JAERE December 2022 - industry sectors after coal
. * => see 5estimations section (2); section (9.5.1)
. 
.         * JAERE - R2.MC7 - Distribution of length of spells in lignite
.         * new january 2023
.         disp("distribution of durations of this sample")
109.         su dur, det
110.         disp("distribution of durations in lignite of this sample")
111.         su dur if thisspelllignite==1, det
112.         disp("distribution of durations in lignite & statsimple==1 of this sample")
113.         su dur if thisspelllignite==1 & statsimple==1, det
114.         disp("")
115.         su dur if thisspelllignite==0 & statsimple==1, det
116. 
.         * test the specific criterion for inclusion 6 months in lignite mining
.         count if dur<=180 
117.         * distributions for durations below 3651 days
.         *                       below 1000 days, below 500 days, below 365 days
. 
. local durations 181 366 500 1000 3700 7300
118. foreach d of local durations {
119.                 cap histogram dur if statsimple==1 & dur<=`d'
120.                 cap graph save dur`d'sample${sample}run`i'.gph, replace
121.                 cap graph export dur`d'sample${sample}run`i'.png, replace
122.         }
123.         
. **********************************************************************
. local i = `i' + 1
124. }               
125. * Table 2 - parameter estimates: 
. *   see   TransitionParameters_MainResults.xlsx
. *       & cellresults.xlsx
. *               & 5_sample2_wages_distribution.xlsx
. *       (all from 5estimations.do) 
. 
unexpected end of file
r(612); t=0.00 9:13:58

end of do-file

r(612); t=0.00 9:13:58
. do "C:\Users\JanserM\AppData\Local\Temp\18\STD6cf8_000000.tmp"

. local i = 1
r; t=0.00 9:14:22

. while `i' < 5 { 
  2. if `i'==1{
  3. *first run descriptive: run analysis on data already loaded
. disp("first column: whole sample")
  4. 
. if `i'==2{
  5. * if i=2, second run: only coal spells
. * reload dataset to generate newly the macro conditions of coal spells
. disp("second column: only coal spells")
  6. use ${data}/precoll.dta, clear
  7. drop if thisspelllignite==0
  8. }
  9. 
. if `i'==3{
 10. * if i=3, third run: only sample used to calculate coal wage distribution
.         if ${sample}<7{
 11.                 use ${data}\wage_sample_wcoal_estimation.dta, clear
 12.         }
 13.         if ${sample}==7{
 14.                 use ${data}\wage_sample7_wcoal_estimation.dta, clear    
 15.                 }
 16.         if ${sample}==8{
 17.                 use ${data}\wage_sample8_wcoal_estimation.dta, clear
 18.         }
 19.         if ${sample}==9{
 20.                 use ${data}\wage_sample9_wcoal_estimation.dta, clear
 21.         }
 22. 
. disp("second column: only wage spells used for coal wage distribution")
 23. keep if (wcoal_end_monthly==.)
 24. }
 25. 
. if `i'==4{
 26. * if i=4, fourth run: only sample used to calculate non-coal wage distribution
. use ${data}\wage_sample_wnc_estimation.dta, clear
 27. disp("second column: only wage spells used for non-coal wage distribution")
 28. keep if (wcoal_end_monthly==. | wnc_offer_tentg_beg==.)
 29. }
 30. 
. 
. *** (!) total number of spells / number of lignite spells / size wage sample
. disp("total number of spells")
 31. count
 32. 
. *** (!) count how many individuals contribute to estimation
. g delfirstpid=.
 33. bys pid: replace delfirstpid=(_n==1)
 34. disp("distinct individuals contributing to estimation")
 35. count if (delfirstpid==1)
 36. drop delfirstpid
 37. 
. *** Define variables for descriptive statistics
. 
.         * (6.1) Categorical age variable agecat2 already defined
.         
.         * (6.2) Define categorical edu variable
.                         * g educat2=. 
.                         * replace educat2 = 1 if bild==1
.                         * replace educat2 = 2 if (bild==2 | bild ==3)
.                         
.         * (6.3) Create resid_area as generalisation of mining area for non-coal jobs
.                         cap drop livarea
 38.                         g livarea=.
 39.                         * Mining Area 1: Lausitz
.                         replace livarea = 1 if ao_kreis == 12052 // Stadt Cottbus (Brandenburg)
 40.                         replace livarea = 1 if ao_kreis == 12061 // LK Dahme-Spreewald (Brandenburg)
 41.                         replace livarea = 1 if ao_kreis == 12062 // LK Elbe-Elster (Brandenburg)
 42.                         replace livarea = 1 if ao_kreis == 12066 // LK Oberspreewald-Lausitz (Brandenburg)
 43.                         replace livarea = 1 if ao_kreis == 12071 // LK Spree-Neisse (Brandenburg)
 44.                         replace livarea = 1 if ao_kreis == 14625 // LK Bautzen (Sachsen)
 45.                         replace livarea = 1 if ao_kreis == 14626 // LK Goerlitz (Sachsen)
 46.                         * Mining Area 2: Mitteldeutsches Revier
.                         replace livarea = 2 if ao_kreis == 14713 // Stadt Leipzig (Sachsen)
 47.                         replace livarea = 2 if ao_kreis == 14729 // LK Leipzig (Sachsen)
 48.                         replace livarea = 2 if ao_kreis == 14730 // LK Nordsachsen (Sachsen)
 49.                         replace livarea = 2 if ao_kreis == 15002 // Stadt Halle(Saale)
 50.                         replace livarea = 2 if ao_kreis == 15082 // LK Anhalt-Bitterfeld (Sachsen-Anhalt)
 51.                         replace livarea = 2 if ao_kreis == 15084 // LK Burgenlandkreis (Sachsen-Anhalt)
 52.                         replace livarea = 2 if ao_kreis == 15087 // LK Mansfeld-Südharz (Sachsen-Anhalt)
 53.                         replace livarea = 2 if ao_kreis == 15088 // LK Saalekreis (Sachsen-Anhalt)
 54.                         replace livarea = 2 if ao_kreis == 15091 // LK Wittenberg (Sachsen-Anhalt)
 55.                         replace livarea = 2 if ao_kreis == 16077 // LK Altenburger Land (Thüringen)
 56.                         replace livarea = 2 if ao_kreis == 16075 // LK Saale-Orla-Kreis (Thüringen)
 57.                         * Mining Area 3: Rheinisches Revier
.                         replace livarea = 3 if ao_kreis == 05112 // Stadt Duisburg (NRW)
 58.                         replace livarea = 3 if ao_kreis == 05162 // LK Rhein-Kreis Neuss (NRW)
 59.                         replace livarea = 3 if ao_kreis == 05315 // Stadt Köln (NRW)
 60.                         replace livarea = 3 if ao_kreis == 05334 // LK Städteregion Aachen (NRW)
 61.                         replace livarea = 3 if ao_kreis == 05362 // LK Rhein-Erft-Kreis (NRW)
 62.                         replace livarea = 3 if ao_kreis == 05358 // LK Düren (NRW)
 63.                         replace livarea = 3 if ao_kreis == 05366 // LK Euskirchen (NRW)
 64.                         * Mining Area 4: Other Coal areas - (first two are Helmstedter Revier)
.                         replace livarea = 4 if ao_kreis == 03154 // LK Helmstedt (Niedersachsen)
 65.                         replace livarea = 4 if ao_kreis == 15083 // LK Börde (Sachsen-Anhalt)
 66.                         replace livarea = 4 if ao_kreis == 03153 // LK Goslar
 67.                         replace livarea = 4 if ao_kreis == 03241 // Region Hannover
 68.                         replace livarea = 4 if ao_kreis == 05570 // LK Warendorf
 69.                         replace livarea = 4 if ao_kreis == 06440 // LK Wetteraukreis
 70.                         replace livarea = 4 if ao_kreis == 06611 // Stadt Kassel
 71.                         replace livarea = 4 if ao_kreis == 06634 // LK Schwalm-Eder-Kreis
 72.                         replace livarea = 4 if ao_kreis == 06636 // LK Werra-Meißner-Kreis
 73.                         replace livarea = 4 if ao_kreis == 09162 // Stadt München
 74.                         replace livarea = 4 if ao_kreis == 09376 // LK Schwandorf
 75.                         replace livarea = 4 if ao_kreis == 09672 // LK Bad Kissingen
 76.                         replace livarea = 4 if ao_kreis == 10041 // Regionalverband Saarbrücken
 77.                         replace livarea = 4 if ao_kreis == 10044 // LK Saarlouis
 78.                         replace livarea = 4 if ao_kreis == 11000 // Stadt Berlin
 79.                         replace livarea = 4 if ao_kreis == 13073 // LK Vorpommern-Rügen
 80.                         replace livarea = 4 if ao_kreis == 14521 // LK Erzgebirgskreis  
 81.                         * Non-Mining Areas 5: Other undefined Reviere
.                         replace livarea = 5 if livarea == . & ao_kreis !=.
 82.                         label define livareas 1 "Lusatia" 2 "Central Germany" 3 "Rhineland" 4 "Other coal area" 5 "Other non-coa
> l areas"
 83.                         label val livarea areas
 84. 
.         * (6.4) Create macroeconomic conditions
. 
.         * Note that the cell-based approach first cuts spells which span
.         * across different macroeconomic conditions. 
.         * Here we do not do this.
.                         
.                 g macro=.
 85. 
.                 * bad macro conditions = 1 / good macro conditions = 2
.                 * approximations here
.                 * (1) good macro is less than 10% unemployment
.                 * (2)   Lausitz:    from (incl) 2015-
.                 *               Rheinisches from (incl) 2007 -
.                 *       Helmstedter from (incl) 2008 - 
.                 *               Mitteldeutsches from (incl) 2016 -
.                 replace macro=1 if mining_area== 1 & endepi<mdy(01,01,2015)
 86.                 replace macro=1 if mining_area== 2 & endepi<mdy(01,01,2016)
 87.                 replace macro=1 if mining_area== 3 & endepi<mdy(01,01,2008)
 88.                 replace macro=1 if mining_area== 4 & endepi<mdy(01,01,2007)
 89.                 
.                 replace macro=2 if mining_area== 1 & endepi>=mdy(01,01,2015)
 90.                 replace macro=2 if mining_area== 2 & endepi>=mdy(01,01,2016)
 91.                 replace macro=2 if mining_area== 3 & endepi>=mdy(01,01,2008)
 92.                 replace macro=2 if mining_area== 4 & endepi>=mdy(01,01,2007)
 93. 
.                 * West-Germany: Unemployment below 10% in all years since 1990 
.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula<12
 94. 
.                 * East Germany: Unemployment below 10% for women since 2012, for men since 2015 
.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2012) & frau==1
 95.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2014) & frau==0
 96.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2012) & frau==1
 97.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2014) & frau==0
 98.                 cap label drop macroLAB
 99.                 label define macroLAB 1 "hi-unemp" 2 "lo-unemp" 
100.                 label values macro macroLAB
101. 
. * produce tables of the descriptive stats for the three datasets
. 
. tab agecat2,m
102. tab frau,m
103. tab educ2,m
104. tab livarea, m
105. tab macro,m
106. tab status, m
107. tab beruf12, m
108. 
. **********************************************************************
. ******
. * JAERE December 2022 - industry sectors after coal
. * => see 5estimations section (2); section (9.5.1)
. 
.         * JAERE - R2.MC7 - Distribution of length of spells in lignite
.         * new january 2023
.         disp("distribution of durations of this sample")
109.         su dur, det
110.         disp("distribution of durations in lignite of this sample")
111.         su dur if thisspelllignite==1, det
112.         disp("distribution of durations in lignite & statsimple==1 of this sample")
113.         su dur if thisspelllignite==1 & statsimple==1, det
114.         disp("")
115.         su dur if thisspelllignite==0 & statsimple==1, det
116. 
.         * test the specific criterion for inclusion 6 months in lignite mining
.         count if dur<=180 
117.         * distributions for durations below 3651 days
.         *                       below 1000 days, below 500 days, below 365 days
. 
. local durations 181 366 500 1000 3700 7300
118. foreach d of local durations {
119.                 cap histogram dur if statsimple==1 & dur<=`d'
120.                 cap graph save dur`d'sample${sample}run`i'.gph, replace
121.                 cap graph export dur`d'sample${sample}run`i'.png, replace
122.         }
123.         
. **********************************************************************
. local i = `i' + 1
124. }               
125. 
unexpected end of file
r(612); t=0.00 9:14:23

end of do-file

r(612); t=0.00 9:14:23
. do "C:\Users\JanserM\AppData\Local\Temp\18\STD6cf8_000000.tmp"

. 
. local i = 1
r; t=0.00 9:14:57

. while `i' < 5 { 
  2. if `i'==1{
  3. *first run descriptive: run analysis on data already loaded
. disp("first column: whole sample")
  4. }
  5. 
. if `i'==2{
  6. * if i=2, second run: only coal spells
. * reload dataset to generate newly the macro conditions of coal spells
. disp("second column: only coal spells")
  7. use ${data}/precoll.dta, clear
  8. drop if thisspelllignite==0
  9. }
 10. 
. if `i'==3{
 11. * if i=3, third run: only sample used to calculate coal wage distribution
.         if ${sample}<7{
 12.                 use ${data}\wage_sample_wcoal_estimation.dta, clear
 13.         }
 14.         if ${sample}==7{
 15.                 use ${data}\wage_sample7_wcoal_estimation.dta, clear    
 16.                 }
 17.         if ${sample}==8{
 18.                 use ${data}\wage_sample8_wcoal_estimation.dta, clear
 19.         }
 20.         if ${sample}==9{
 21.                 use ${data}\wage_sample9_wcoal_estimation.dta, clear
 22.         }
 23. 
. disp("second column: only wage spells used for coal wage distribution")
 24. keep if (wcoal_end_monthly==.)
 25. }
 26. 
. if `i'==4{
 27. * if i=4, fourth run: only sample used to calculate non-coal wage distribution
. use ${data}\wage_sample_wnc_estimation.dta, clear
 28. disp("second column: only wage spells used for non-coal wage distribution")
 29. keep if (wcoal_end_monthly==. | wnc_offer_tentg_beg==.)
 30. }
 31. 
. 
. *** (!) total number of spells / number of lignite spells / size wage sample
. disp("total number of spells")
 32. count
 33. 
. *** (!) count how many individuals contribute to estimation
. g delfirstpid=.
 34. bys pid: replace delfirstpid=(_n==1)
 35. disp("distinct individuals contributing to estimation")
 36. count if (delfirstpid==1)
 37. drop delfirstpid
 38. 
. *** Define variables for descriptive statistics
. 
.         * (6.1) Categorical age variable agecat2 already defined
.         
.         * (6.2) Define categorical edu variable
.                         * g educat2=. 
.                         * replace educat2 = 1 if bild==1
.                         * replace educat2 = 2 if (bild==2 | bild ==3)
.                         
.         * (6.3) Create resid_area as generalisation of mining area for non-coal jobs
.                         cap drop livarea
 39.                         g livarea=.
 40.                         * Mining Area 1: Lausitz
.                         replace livarea = 1 if ao_kreis == 12052 // Stadt Cottbus (Brandenburg)
 41.                         replace livarea = 1 if ao_kreis == 12061 // LK Dahme-Spreewald (Brandenburg)
 42.                         replace livarea = 1 if ao_kreis == 12062 // LK Elbe-Elster (Brandenburg)
 43.                         replace livarea = 1 if ao_kreis == 12066 // LK Oberspreewald-Lausitz (Brandenburg)
 44.                         replace livarea = 1 if ao_kreis == 12071 // LK Spree-Neisse (Brandenburg)
 45.                         replace livarea = 1 if ao_kreis == 14625 // LK Bautzen (Sachsen)
 46.                         replace livarea = 1 if ao_kreis == 14626 // LK Goerlitz (Sachsen)
 47.                         * Mining Area 2: Mitteldeutsches Revier
.                         replace livarea = 2 if ao_kreis == 14713 // Stadt Leipzig (Sachsen)
 48.                         replace livarea = 2 if ao_kreis == 14729 // LK Leipzig (Sachsen)
 49.                         replace livarea = 2 if ao_kreis == 14730 // LK Nordsachsen (Sachsen)
 50.                         replace livarea = 2 if ao_kreis == 15002 // Stadt Halle(Saale)
 51.                         replace livarea = 2 if ao_kreis == 15082 // LK Anhalt-Bitterfeld (Sachsen-Anhalt)
 52.                         replace livarea = 2 if ao_kreis == 15084 // LK Burgenlandkreis (Sachsen-Anhalt)
 53.                         replace livarea = 2 if ao_kreis == 15087 // LK Mansfeld-Südharz (Sachsen-Anhalt)
 54.                         replace livarea = 2 if ao_kreis == 15088 // LK Saalekreis (Sachsen-Anhalt)
 55.                         replace livarea = 2 if ao_kreis == 15091 // LK Wittenberg (Sachsen-Anhalt)
 56.                         replace livarea = 2 if ao_kreis == 16077 // LK Altenburger Land (Thüringen)
 57.                         replace livarea = 2 if ao_kreis == 16075 // LK Saale-Orla-Kreis (Thüringen)
 58.                         * Mining Area 3: Rheinisches Revier
.                         replace livarea = 3 if ao_kreis == 05112 // Stadt Duisburg (NRW)
 59.                         replace livarea = 3 if ao_kreis == 05162 // LK Rhein-Kreis Neuss (NRW)
 60.                         replace livarea = 3 if ao_kreis == 05315 // Stadt Köln (NRW)
 61.                         replace livarea = 3 if ao_kreis == 05334 // LK Städteregion Aachen (NRW)
 62.                         replace livarea = 3 if ao_kreis == 05362 // LK Rhein-Erft-Kreis (NRW)
 63.                         replace livarea = 3 if ao_kreis == 05358 // LK Düren (NRW)
 64.                         replace livarea = 3 if ao_kreis == 05366 // LK Euskirchen (NRW)
 65.                         * Mining Area 4: Other Coal areas - (first two are Helmstedter Revier)
.                         replace livarea = 4 if ao_kreis == 03154 // LK Helmstedt (Niedersachsen)
 66.                         replace livarea = 4 if ao_kreis == 15083 // LK Börde (Sachsen-Anhalt)
 67.                         replace livarea = 4 if ao_kreis == 03153 // LK Goslar
 68.                         replace livarea = 4 if ao_kreis == 03241 // Region Hannover
 69.                         replace livarea = 4 if ao_kreis == 05570 // LK Warendorf
 70.                         replace livarea = 4 if ao_kreis == 06440 // LK Wetteraukreis
 71.                         replace livarea = 4 if ao_kreis == 06611 // Stadt Kassel
 72.                         replace livarea = 4 if ao_kreis == 06634 // LK Schwalm-Eder-Kreis
 73.                         replace livarea = 4 if ao_kreis == 06636 // LK Werra-Meißner-Kreis
 74.                         replace livarea = 4 if ao_kreis == 09162 // Stadt München
 75.                         replace livarea = 4 if ao_kreis == 09376 // LK Schwandorf
 76.                         replace livarea = 4 if ao_kreis == 09672 // LK Bad Kissingen
 77.                         replace livarea = 4 if ao_kreis == 10041 // Regionalverband Saarbrücken
 78.                         replace livarea = 4 if ao_kreis == 10044 // LK Saarlouis
 79.                         replace livarea = 4 if ao_kreis == 11000 // Stadt Berlin
 80.                         replace livarea = 4 if ao_kreis == 13073 // LK Vorpommern-Rügen
 81.                         replace livarea = 4 if ao_kreis == 14521 // LK Erzgebirgskreis  
 82.                         * Non-Mining Areas 5: Other undefined Reviere
.                         replace livarea = 5 if livarea == . & ao_kreis !=.
 83.                         label define livareas 1 "Lusatia" 2 "Central Germany" 3 "Rhineland" 4 "Other coal area" 5 "Other non-coa
> l areas"
 84.                         label val livarea areas
 85. 
.         * (6.4) Create macroeconomic conditions
. 
.         * Note that the cell-based approach first cuts spells which span
.         * across different macroeconomic conditions. 
.         * Here we do not do this.
.                         
.                 g macro=.
 86. 
.                 * bad macro conditions = 1 / good macro conditions = 2
.                 * approximations here
.                 * (1) good macro is less than 10% unemployment
.                 * (2)   Lausitz:    from (incl) 2015-
.                 *               Rheinisches from (incl) 2007 -
.                 *       Helmstedter from (incl) 2008 - 
.                 *               Mitteldeutsches from (incl) 2016 -
.                 replace macro=1 if mining_area== 1 & endepi<mdy(01,01,2015)
 87.                 replace macro=1 if mining_area== 2 & endepi<mdy(01,01,2016)
 88.                 replace macro=1 if mining_area== 3 & endepi<mdy(01,01,2008)
 89.                 replace macro=1 if mining_area== 4 & endepi<mdy(01,01,2007)
 90.                 
.                 replace macro=2 if mining_area== 1 & endepi>=mdy(01,01,2015)
 91.                 replace macro=2 if mining_area== 2 & endepi>=mdy(01,01,2016)
 92.                 replace macro=2 if mining_area== 3 & endepi>=mdy(01,01,2008)
 93.                 replace macro=2 if mining_area== 4 & endepi>=mdy(01,01,2007)
 94. 
.                 * West-Germany: Unemployment below 10% in all years since 1990 
.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula<12
 95. 
.                 * East Germany: Unemployment below 10% for women since 2012, for men since 2015
.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2012) & frau==1
 96.                 replace macro=1 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi<mdy(01,01,2014) & frau==0
 97.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2012) & frau==1
 98.                 replace macro=2 if (mining_area==. | mining_area==5) & ao_bula>=12 & endepi>=mdy(01,01,2014) & frau==0
 99.                 cap label drop macroLAB
100.                 label define macroLAB 1 "hi-unemp" 2 "lo-unemp" 
101.                 label values macro macroLAB
102. 
. * produce tables of the descriptive stats for the three datasets
. 
. tab agecat2,m
103. tab frau,m
104. tab educ2,m
105. tab livarea, m
106. tab macro,m
107. tab status, m
108. tab beruf12, m
109. 
. **********************************************************************
. ******
. * JAERE December 2022 - industry sectors after coal
. * => see 5estimations section (2); section (9.5.1)
. 
.         * JAERE - R2.MC7 - Distribution of length of spells in lignite
.         * new january 2023
.         disp("distribution of durations of this sample")
110.         su dur, det
111.         disp("distribution of durations in lignite of this sample")
112.         su dur if thisspelllignite==1, det
113.         disp("distribution of durations in lignite & statsimple==1 of this sample")
114.         su dur if thisspelllignite==1 & statsimple==1, det
115.         disp("")
116.         su dur if thisspelllignite==0 & statsimple==1, det
117. 
.         * test the specific criterion for inclusion 6 months in lignite mining
.         count if dur<=180 
118.         * distributions for durations below 3651 days
.         *                       below 1000 days, below 500 days, below 365 days
. 
. local durations 181 366 500 1000 3700 7300
119. foreach d of local durations {
120.                 cap histogram dur if statsimple==1 & dur<=`d'
121.                 cap graph save dur`d'sample${sample}run`i'.gph, replace
122.                 cap graph export dur`d'sample${sample}run`i'.png, replace
123.         }
124.         
. **********************************************************************
. local i = `i' + 1
125. }               
first column: whole sample
total number of spells
  1,456,030
(1,456,030 missing values generated)
(1456030 real changes made)
distinct individuals contributing to estimation
  146,916
(1,456,030 missing values generated)
(36,731 real changes made)
(4,991 real changes made)
(8,335 real changes made)
(120,252 real changes made)
(69,475 real changes made)
(64,142 real changes made)
(23,243 real changes made)
(27,768 real changes made)
(63,831 real changes made)
(9,144 real changes made)
(17,026 real changes made)
(25,612 real changes made)
(35,444 real changes made)
(7,982 real changes made)
(17,306 real changes made)
(5,797 real changes made)
(12,422 real changes made)
(546 real changes made)
(1,398 real changes made)
(31,721 real changes made)
(47,082 real changes made)
(29,057 real changes made)
(85,682 real changes made)
(22,225 real changes made)
(1,295 real changes made)
(27,683 real changes made)
(1,474 real changes made)
(666 real changes made)
(4,403 real changes made)
(320 real changes made)
(4,278 real changes made)
(1,479 real changes made)
(4,539 real changes made)
(1,563 real changes made)
(5,174 real changes made)
(10,054 real changes made)
(129 real changes made)
(3,026 real changes made)
(585 real changes made)
(11,693 real changes made)
(306 real changes made)
(837 real changes made)
(609,314 real changes made)
(1,456,030 missing values generated)
(263,883 real changes made)
(183,548 real changes made)
(18,678 real changes made)
(134,584 real changes made)
(31,670 real changes made)
(17,643 real changes made)
(4,656 real changes made)
(44,225 real changes made)
(653,828 real changes made)
(19,232 real changes made)
(64,840 real changes made)
(6,644 real changes made)
(12,599 real changes made)

 age at end |
of spell by |
   category |      Freq.     Percent        Cum.
------------+-----------------------------------
   age18-30 |    371,112       25.49       25.49
   age31-49 |    627,530       43.10       68.59
     age50+ |    457,388       31.41      100.00
------------+-----------------------------------
      Total |  1,456,030      100.00

       frau |      Freq.     Percent        Cum.
------------+-----------------------------------
       mann |  1,144,848       78.63       78.63
       frau |    311,182       21.37      100.00
------------+-----------------------------------
      Total |  1,456,030      100.00

        education 2 |
         categories |      Freq.     Percent        Cum.
--------------------+-----------------------------------
keine abg. Ausbild. |    183,457       12.60       12.60
    abg. Ausbildung |  1,246,334       85.60       98.20
                  . |     26,239        1.80      100.00
--------------------+-----------------------------------
              Total |  1,456,030      100.00

           livarea |      Freq.     Percent        Cum.
-------------------+-----------------------------------
  Lausitzer Revier |    327,169       22.47       22.47
  Mitteldt. Revier |    222,878       15.31       37.78
Helmstedter Revier |    218,460       15.00       52.78
Rheinisches Revier |     78,209        5.37       58.15
     Other Reviere |    609,314       41.85      100.00
-------------------+-----------------------------------
             Total |  1,456,030      100.00

      macro |      Freq.     Percent        Cum.
------------+-----------------------------------
   hi-unemp |    684,765       47.03       47.03
   lo-unemp |    771,265       52.97      100.00
------------+-----------------------------------
      Total |  1,456,030      100.00

                      status |      Freq.     Percent        Cum.
-----------------------------+-----------------------------------
                  unemployed |    348,165       23.91       23.91
            active_labour_mp |     15,355        1.05       24.97
         marginal_employment |     54,888        3.77       28.74
normal_employment_(FT_or_PT) |    729,296       50.09       78.82
         vocational_training |     99,984        6.87       85.69
                          10 |    208,342       14.31      100.00
-----------------------------+-----------------------------------
                       Total |  1,456,030      100.00

  top ten occupations in mining + other |      Freq.     Percent        Cum.
----------------------------------------+-----------------------------------
        Maschinen-Fahrzeugtechnikberufe |    177,417       12.18       12.18
      Unternehmensführung,-organisation |     94,381        6.48       18.67
 Führer/innenFahrzeug-,Transportgeräten |    113,147        7.77       26.44
Metallerzeugung-bearbeitung,Metallbaube |     91,044        6.25       32.69
Verkehrs-,Logistikberufe(außerFahrzeugf |     64,762        4.45       37.14
TechnischeForschungs-Entwicklungsberufe |     40,507        2.78       39.92
                     Hoch-Tiefbauberufe |     96,900        6.66       46.58
Rohstoffgewinnung-aufbereitung,Glas-Ker |     31,576        2.17       48.74
      Mechatronik-Energie-Elektroberufe |     37,969        2.61       51.35
   Gebäude-versorgungstechnische Berufe |     34,670        2.38       53.73
                      Other occupations |    465,315       31.96       85.69
                                      . |    208,342       14.31      100.00
----------------------------------------+-----------------------------------
                                  Total |  1,456,030      100.00
distribution of durations of this sample

                             dur
-------------------------------------------------------------
      Percentiles      Smallest
 1%            4              1
 5%           23              1
10%           36              1       Obs           1,456,030
25%           94              1       Sum of wgt.   1,456,030

50%          303                      Mean           727.5402
                        Largest       Std. dev.      1271.004
75%          731          15188
90%         1826          15691       Variance        1615451
95%         3167          15704       Skewness        3.93741
99%         6558          15706       Kurtosis       23.68999
distribution of durations in lignite of this sample

                             dur
-------------------------------------------------------------
      Percentiles      Smallest
 1%            9              1
 5%           31              1
10%           90              1       Obs             307,899
25%          274              1       Sum of wgt.     307,899

50%          456                      Mean           1201.078
                        Largest       Std. dev.      1854.691
75%         1096          15188
90%         3409          15691       Variance        3439878
95%         5310          15704       Skewness        3.04663
99%         9191          15706       Kurtosis       14.02561
distribution of durations in lignite & statsimple==1 of this sample

                             dur
-------------------------------------------------------------
      Percentiles      Smallest
 1%           22              1
 5%           90              1
10%          181              1       Obs             230,930
25%          365              1       Sum of wgt.     230,930

50%          731                      Mean           1520.229
                        Largest       Std. dev.      2040.943
75%         1720          15188
90%         4018          15691       Variance        4165446
95%         6028          15704       Skewness       2.612395
99%         9497          15706       Kurtosis       10.95157


                             dur
-------------------------------------------------------------
      Percentiles      Smallest
 1%            3              1
 5%           22              1
10%           43              1       Obs             498,366
25%          122              1       Sum of wgt.     498,366

50%          335                      Mean           808.1262
                        Largest       Std. dev.      1270.883
75%          887          14610
90%         2191          14610       Variance        1615144
95%         3432          14610       Skewness       3.178368
99%         6403          14610       Kurtosis       15.80092
  542,889
second column: only coal spells
(939,789 observations deleted)
total number of spells
  516,241
(516,241 missing values generated)
(516241 real changes made)
distinct individuals contributing to estimation
  140,127
(516,241 missing values generated)
(17,724 real changes made)
(516 real changes made)
(971 real changes made)
(58,562 real changes made)
(44,325 real changes made)
(19,988 real changes made)
(4,346 real changes made)
(3,055 real changes made)
(34,105 real changes made)
(1,036 real changes made)
(9,356 real changes made)
(7,323 real changes made)
(20,277 real changes made)
(3,658 real changes made)
(2,020 real changes made)
(542 real changes made)
(1,307 real changes made)
(47 real changes made)
(382 real changes made)
(23,212 real changes made)
(31,111 real changes made)
(18,658 real changes made)
(56,351 real changes made)
(13,168 real changes made)
(263 real changes made)
(20,051 real changes made)
(172 real changes made)
(213 real changes made)
(1,079 real changes made)
(55 real changes made)
(2,745 real changes made)
(321 real changes made)
(3,089 real changes made)
(809 real changes made)
(1,856 real changes made)
(5,858 real changes made)
(12 real changes made)
(799 real changes made)
(84 real changes made)
(2,403 real changes made)
(44 real changes made)
(194 real changes made)
(104,154 real changes made)
(516,241 missing values generated)
(106,096 real changes made)
(57,832 real changes made)
(12,451 real changes made)
(83,745 real changes made)
(8,720 real changes made)
(3,207 real changes made)
(1,949 real changes made)
(19,749 real changes made)
(163,077 real changes made)
(12,917 real changes made)
(35,960 real changes made)
(4,061 real changes made)
(6,477 real changes made)

 age at end |
of spell by |
   category |      Freq.     Percent        Cum.
------------+-----------------------------------
   age18-30 |    161,996       31.38       31.38
   age31-49 |    184,546       35.75       67.13
     age50+ |    169,699       32.87      100.00
------------+-----------------------------------
      Total |    516,241      100.00

       frau |      Freq.     Percent        Cum.
------------+-----------------------------------
       mann |    415,187       80.43       80.43
       frau |    101,054       19.57      100.00
------------+-----------------------------------
      Total |    516,241      100.00

        education 2 |
         categories |      Freq.     Percent        Cum.
--------------------+-----------------------------------
keine abg. Ausbild. |    114,576       22.19       22.19
    abg. Ausbildung |    385,410       74.66       96.85
                  . |     16,255        3.15      100.00
--------------------+-----------------------------------
              Total |    516,241      100.00

           livarea |      Freq.     Percent        Cum.
-------------------+-----------------------------------
  Lausitzer Revier |    146,432       28.37       28.37
  Mitteldt. Revier |     82,726       16.02       44.39
Helmstedter Revier |    143,145       27.73       72.12
Rheinisches Revier |     39,784        7.71       79.82
     Other Reviere |    104,154       20.18      100.00
-------------------+-----------------------------------
             Total |    516,241      100.00

      macro |      Freq.     Percent        Cum.
------------+-----------------------------------
   hi-unemp |    309,001       59.86       59.86
   lo-unemp |    207,240       40.14      100.00
------------+-----------------------------------
      Total |    516,241      100.00

                      status |      Freq.     Percent        Cum.
-----------------------------+-----------------------------------
         marginal_employment |      8,525        1.65        1.65
normal_employment_(FT_or_PT) |    230,930       44.73       46.38
         vocational_training |     68,444       13.26       59.64
                          10 |    208,342       40.36      100.00
-----------------------------+-----------------------------------
                       Total |    516,241      100.00

  top ten occupations in mining + other |      Freq.     Percent        Cum.
----------------------------------------+-----------------------------------
        Maschinen-Fahrzeugtechnikberufe |     87,486       16.95       16.95
      Unternehmensführung,-organisation |     32,338        6.26       23.21
 Führer/innenFahrzeug-,Transportgeräten |     25,986        5.03       28.24
Metallerzeugung-bearbeitung,Metallbaube |     27,589        5.34       33.59
Verkehrs-,Logistikberufe(außerFahrzeugf |     19,636        3.80       37.39
TechnischeForschungs-Entwicklungsberufe |     18,775        3.64       41.03
                     Hoch-Tiefbauberufe |     13,626        2.64       43.67
Rohstoffgewinnung-aufbereitung,Glas-Ker |     15,684        3.04       46.71
      Mechatronik-Energie-Elektroberufe |      7,814        1.51       48.22
   Gebäude-versorgungstechnische Berufe |      7,662        1.48       49.70
                      Other occupations |     51,303        9.94       59.64
                                      . |    208,342       40.36      100.00
----------------------------------------+-----------------------------------
                                  Total |    516,241      100.00
distribution of durations of this sample

                             dur
-------------------------------------------------------------
      Percentiles      Smallest
 1%           15              1
 5%           31              1
10%           46              1       Obs             516,241
25%          111              1       Sum of wgt.     516,241

50%          365                      Mean           859.4685
                        Largest       Std. dev.      1551.606
75%          731          15188
90%         2223          15691       Variance        2407481
95%         3956          15704       Skewness       3.763749
99%         8036          15706       Kurtosis       20.54085
distribution of durations in lignite of this sample

                             dur
-------------------------------------------------------------
      Percentiles      Smallest
 1%            9              1
 5%           31              1
10%           90              1       Obs             307,899
25%          274              1       Sum of wgt.     307,899

50%          456                      Mean           1201.078
                        Largest       Std. dev.      1854.691
75%         1096          15188
90%         3409          15691       Variance        3439878
95%         5310          15704       Skewness        3.04663
99%         9191          15706       Kurtosis       14.02561
distribution of durations in lignite & statsimple==1 of this sample

                             dur
-------------------------------------------------------------
      Percentiles      Smallest
 1%           22              1
 5%           90              1
10%          181              1       Obs             230,930
25%          365              1       Sum of wgt.     230,930

50%          731                      Mean           1520.229
                        Largest       Std. dev.      2040.943
75%         1720          15188
90%         4018          15691       Variance        4165446
95%         6028          15704       Skewness       2.612395
99%         9497          15706       Kurtosis       10.95157


                             dur
-------------------------------------------------------------
no observations
  171,856
second column: only wage spells used for coal wage distribution
(22,272 observations deleted)
total number of spells
  0
distinct individuals contributing to estimation
  0
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
no observations
no observations
no observations
no observations
no observations
no observations
no observations
distribution of durations of this sample

                             dur
-------------------------------------------------------------
no observations
distribution of durations in lignite of this sample

                             dur
-------------------------------------------------------------
no observations
distribution of durations in lignite & statsimple==1 of this sample

                             dur
-------------------------------------------------------------
no observations


                             dur
-------------------------------------------------------------
no observations
  0
second column: only wage spells used for non-coal wage distribution
(0 observations deleted)
total number of spells
  15,392
(15,392 missing values generated)
(15392 real changes made)
distinct individuals contributing to estimation
  15,346
(15,392 missing values generated)
(420 real changes made)
(125 real changes made)
(190 real changes made)
(1,930 real changes made)
(776 real changes made)
(1,634 real changes made)
(765 real changes made)
(764 real changes made)
(1,423 real changes made)
(500 real changes made)
(244 real changes made)
(817 real changes made)
(747 real changes made)
(176 real changes made)
(844 real changes made)
(291 real changes made)
(643 real changes made)
(4 real changes made)
(6 real changes made)
(45 real changes made)
(109 real changes made)
(51 real changes made)
(153 real changes made)
(35 real changes made)
(6 real changes made)
(50 real changes made)
(27 real changes made)
(7 real changes made)
(28 real changes made)
(0 real changes made)
(37 real changes made)
(9 real changes made)
(36 real changes made)
(20 real changes made)
(41 real changes made)
(331 real changes made)
(6 real changes made)
(8 real changes made)
(3 real changes made)
(90 real changes made)
(12 real changes made)
(17 real changes made)
(1,972 real changes made)
(15,392 missing values generated)
(5,710 real changes made)
(6,322 real changes made)
(66 real changes made)
(346 real changes made)
(130 real changes made)
(131 real changes made)
(11 real changes made)
(59 real changes made)
(1,658 real changes made)
(292 real changes made)
(643 real changes made)
(5 real changes made)
(19 real changes made)

 age at end |
of spell by |
   category |      Freq.     Percent        Cum.
------------+-----------------------------------
   age18-30 |      3,410       22.15       22.15
   age31-49 |      9,036       58.71       80.86
     age50+ |      2,946       19.14      100.00
------------+-----------------------------------
      Total |     15,392      100.00

       frau |      Freq.     Percent        Cum.
------------+-----------------------------------
       mann |      9,990       64.90       64.90
       frau |      5,402       35.10      100.00
------------+-----------------------------------
      Total |     15,392      100.00

        education 2 |
         categories |      Freq.     Percent        Cum.
--------------------+-----------------------------------
keine abg. Ausbild. |        909        5.91        5.91
    abg. Ausbildung |     14,457       93.93       99.83
                  . |         NA          NA          NA
--------------------+-----------------------------------
              Total |     15,392      100.00

           livarea |      Freq.     Percent        Cum.
-------------------+-----------------------------------
  Lausitzer Revier |      5,840       37.94       37.94
  Mitteldt. Revier |      6,453       41.92       79.87
Helmstedter Revier |        405        2.63       82.50
Rheinisches Revier |        722        4.69       87.19
     Other Reviere |      1,972       12.81      100.00
-------------------+-----------------------------------
             Total |     15,392      100.00

      macro |      Freq.     Percent        Cum.
------------+-----------------------------------
   hi-unemp |     13,379       86.92       86.92
   lo-unemp |      2,013       13.08      100.00
------------+-----------------------------------
      Total |     15,392      100.00

                      status |      Freq.     Percent        Cum.
-----------------------------+-----------------------------------
normal_employment_(FT_or_PT) |     15,392      100.00      100.00
-----------------------------+-----------------------------------
                       Total |     15,392      100.00

  top ten occupations in mining + other |      Freq.     Percent        Cum.
----------------------------------------+-----------------------------------
        Maschinen-Fahrzeugtechnikberufe |      1,491        9.69        9.69
      Unternehmensführung,-organisation |      1,300        8.45       18.13
 Führer/innenFahrzeug-,Transportgeräten |        940        6.11       24.24
Metallerzeugung-bearbeitung,Metallbaube |      1,195        7.76       32.00
Verkehrs-,Logistikberufe(außerFahrzeugf |        643        4.18       36.18
TechnischeForschungs-Entwicklungsberufe |        424        2.75       38.94
                     Hoch-Tiefbauberufe |      2,393       15.55       54.48
Rohstoffgewinnung-aufbereitung,Glas-Ker |        149        0.97       55.45
      Mechatronik-Energie-Elektroberufe |        254        1.65       57.10
   Gebäude-versorgungstechnische Berufe |        577        3.75       60.85
                      Other occupations |      6,026       39.15      100.00
----------------------------------------+-----------------------------------
                                  Total |     15,392      100.00
distribution of durations of this sample

                             dur
-------------------------------------------------------------
      Percentiles      Smallest
 1%            4              1
 5%           26              1
10%           51              1       Obs              15,392
25%          138              1       Sum of wgt.      15,392

50%          365                      Mean           851.6349
                        Largest       Std. dev.      1497.454
75%        750.5          11714
90%         2221          12019       Variance        2242368
95%         3818          13241       Skewness       3.430705
99%         8166          13678       Kurtosis       16.08673
distribution of durations in lignite of this sample

                             dur
-------------------------------------------------------------
no observations
distribution of durations in lignite & statsimple==1 of this sample

                             dur
-------------------------------------------------------------
no observations


                             dur
-------------------------------------------------------------
      Percentiles      Smallest
 1%            4              1
 5%           26              1
10%           51              1       Obs              15,392
25%          138              1       Sum of wgt.      15,392

50%          365                      Mean           851.6349
                        Largest       Std. dev.      1497.454
75%        750.5          11714
90%         2221          12019       Variance        2242368
95%         3818          13241       Skewness       3.430705
99%         8166          13678       Kurtosis       16.08673
  4,696
r; t=0.00 9:16:19

. 
end of do-file

r; t=0.00 9:16:19
. do "C:\Users\JanserM\AppData\Local\Temp\18\STD6cf8_000000.tmp"

. 
. clear
r; t=0.00 9:19:18

. 
end of do-file

r; t=0.00 9:19:18
. do "C:\Users\JanserM\AppData\Local\Temp\18\STD6cf8_000000.tmp"

. ** CLOSE LOG-FILE **    
. if ${log_active}==1 {$
.         capture log close
